diff options
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/doc.go | 2 | ||||
-rw-r--r-- | rpc/ipc_windows.go | 6 | ||||
-rw-r--r-- | rpc/server.go | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/rpc/doc.go b/rpc/doc.go index 77202634f..14b3780ad 100644 --- a/rpc/doc.go +++ b/rpc/doc.go @@ -49,7 +49,7 @@ arguments. It will pass the mod argument as nil to the RPC method. The server offers the ServeCodec method which accepts a ServerCodec instance. It will read requests from the codec, process the request and sends the response back to the client using the codec. The server can execute requests concurrently. Responses -can be send back to the client out of order. +can be sent back to the client out of order. An example server which uses the JSON codec: type CalculatorService struct {} diff --git a/rpc/ipc_windows.go b/rpc/ipc_windows.go index 8762cdb0d..8342d04d5 100644 --- a/rpc/ipc_windows.go +++ b/rpc/ipc_windows.go @@ -22,16 +22,16 @@ import ( "net" "time" - winio "github.com/microsoft/go-winio" + "gopkg.in/natefinch/npipe.v2" ) // ipcListen will create a named pipe on the given endpoint. func ipcListen(endpoint string) (net.Listener, error) { - return winio.ListenPipe(endpoint, &winio.PipeConfig{}) + return npipe.Listen(endpoint) } // newIPCConnection will connect to a named pipe with the given endpoint as name. func newIPCConnection(endpoint string) (net.Conn, error) { timeout := 5 * time.Second - return winio.DialPipe(endpoint, &timeout) + return npipe.DialTimeout(endpoint, timeout) } diff --git a/rpc/server.go b/rpc/server.go index 69f3271e8..7b7d22063 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -82,7 +82,7 @@ func (s *RPCService) Modules() map[string]string { return modules } -// RegisterName will create an service for the given rcvr type under the given name. When no methods on the given rcvr +// RegisterName will create a service for the given rcvr type under the given name. When no methods on the given rcvr // match the criteria to be either a RPC method or a subscription an error is returned. Otherwise a new service is // created and added to the service collection this server instance serves. func (s *Server) RegisterName(name string, rcvr interface{}) error { @@ -236,7 +236,7 @@ func (s *Server) ServeSingleRequest(codec ServerCodec, options CodecOption) { } // Stop will stop reading new requests, wait for stopPendingRequestTimeout to allow pending requests to finish, -// close all codecs which will cancels pending requests/subscriptions. +// close all codecs which will cancel pending requests/subscriptions. func (s *Server) Stop() { if atomic.CompareAndSwapInt32(&s.run, 1, 0) { glog.V(logger.Debug).Infoln("RPC Server shutdown initiatied") @@ -294,7 +294,7 @@ func (s *Server) handle(ctx context.Context, codec ServerCodec, req *serverReque return codec.CreateErrorResponse(&req.id, &callbackError{err.Error()}), nil } - // active the subscription after the sub id was successful sent to the client + // active the subscription after the sub id was successfully sent to the client activateSub := func() { notifier, _ := NotifierFromContext(ctx) notifier.(*bufferedNotifier).activate(subid) |