Example #1
0
// ServeCodec calls ServeCodec for the appropriate server
// (authenticated or default).
func (h *rpcHandler) ServeCodecWithContext(c rpc.ServerCodec, context *proto.Context) {
	if h.useAuth {
		AuthenticatedServer.ServeCodecWithContext(c, context)
	} else {
		rpc.ServeCodecWithContext(c, context)
	}
}
Example #2
0
// ServeConnWithContext is like ServeConn but it allows to pass a
// connection context to the RPC methods.
func ServeConnWithContext(conn io.ReadWriteCloser, context interface{}) {
	rpc.ServeCodecWithContext(NewServerCodec(conn), context)
}