Exemplo n.º 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)
	}
}
Exemplo n.º 2
0
// ServeConnWithContext is like ServeConn but it allows to pass a
// connection context to the RPC methods.
func ServeConnWithContext(ctx context.Context, conn io.ReadWriteCloser) {
	rpc.ServeCodecWithContext(ctx, NewServerCodec(conn))
}
Exemplo n.º 3
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)
}