Descriptionnet/rpc/jsonrpc: Add HTTP support
Because http server/client create ServerCodec/ClientCodec in net/rpc package,
so we need pass ServerCodec/ClientCodec factory to rpc.Server/rpc.Client.
New type/func for net/rpc package:
type ClientCodecFactory interface {
NewClientCodec(conn io.ReadWriteCloser) ClientCodec
}
type ServerCodecFactory interface {
NewServerCodec(conn io.ReadWriteCloser) ServerCodec
}
func DialWithCodecFactory(network, address string, factory ClientCodecFactory) (*Client, error)
func DialHTTPWithCodecFactory(network, address string, factory ClientCodecFactory) (*Client, error)
func DialHTTPPathWithCodecFactory(network, address, path string, factory ClientCodecFactory) (*Client, error)
func NewServerWithCodecFactory(factory ServerCodecFactory) *Server
New type/func for net/rpc/jsonrpc package:
func NewClientCodecFactory(conn io.ReadWriteCloser) rpc.ClientCodec
func NewServerCodecFactory() rpc.ServerCodecFactory
Fixes issue 2738.
Patch Set 1 #Patch Set 2 : diff -r fccd815ed3bb http://code.google.com/p/go #Patch Set 3 : diff -r fccd815ed3bb http://code.google.com/p/go #Patch Set 4 : diff -r 166d946fa77f http://code.google.com/p/go #Patch Set 5 : diff -r 166d946fa77f http://code.google.com/p/go #Patch Set 6 : diff -r 166d946fa77f http://code.google.com/p/go #
MessagesTotal messages: 2
|