Documentation ¶
Overview ¶
The ncrpc package layers client-server and server-client RPC interfaces on top of netchan.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents an ncrpc client. Importer holds the underlying netchan connection, and Server can be used to make calls to the server RPC interface.
type Server ¶
type Server struct { Exporter *netchan.Exporter RPCServer *rpc.Server // contains filtered or unexported fields }
func NewServer ¶
NewServer creates a new RPC-over-netchan server. It returns a new Server instance containing a netchan.Exporter and an rpc.Server which is listening on a channel within it. It reserves the use of netchan channels with the prefix "ncrpc".
If acceptClientRPC is true, the server will accept incoming client RPC registrations made by Client.Serve.
Conventionally Register is called on the rpc.Server to export some server RPC methods, and ListenAndServe is then called on the netchan.Exporter to listen on the network.
func (*Server) ClientNames ¶
ClientNames returns the list of all clients that have published RPC connections to the server.