-
Notifications
You must be signed in to change notification settings - Fork 229
Closed
Description
Is your feature request related to a problem? Please describe.
The runtime rpc server is setup accordingly to the example shown in the documentation. However, it uses methods targeting a default server, so the setup isn't clear. Since the default server is mostly hidden, from the outside it seems random functions doing things without a clear connection among each other.
Describe the solution you'd like
A more explicit setup.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Target code is in
ocis/ocis/pkg/runtime/service/service.go
Lines 492 to 512 in dd184e2
| func (s *Service) runRPCServer() { | |
| if err := rpc.Register(s); err != nil { | |
| if s != nil { | |
| s.Log.Fatal().Err(err).Msg("could not register rpc service") | |
| return | |
| } | |
| } | |
| rpc.HandleHTTP() | |
| // run rpc server | |
| srv := new(http.Server) | |
| go func() { | |
| l, err := net.Listen("tcp", net.JoinHostPort(s.cfg.Runtime.Host, s.cfg.Runtime.Port)) | |
| if err != nil { | |
| s.Log.Fatal().Err(err).Msg("could not start listener") | |
| return | |
| } | |
| if err = srv.Serve(l); err != nil && !errors.Is(err, http.ErrServerClosed) { | |
| s.Log.Fatal().Err(err).Msg("could not start rpc server") | |
| } | |
| }() | |
| } |
There are some methods to configure rpc and a server listening in a "random" port, but no clear connection between the two.
Metadata
Metadata
Assignees
Labels
No labels