Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(229)

Issue 10704046: code review 10704046: net/rpc/jsonrpc: Add HTTP support (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by chai2010
Modified:
10 years, 8 months ago
Reviewers:
rsc, golang-dev
Visibility:
Public.

Description

net/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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -7 lines) Patch
M src/pkg/net/rpc/client.go View 1 4 chunks +36 lines, -3 lines 0 comments Download
M src/pkg/net/rpc/jsonrpc/all_test.go View 1 2 chunks +48 lines, -0 lines 0 comments Download
M src/pkg/net/rpc/jsonrpc/client.go View 1 2 chunks +15 lines, -0 lines 0 comments Download
M src/pkg/net/rpc/jsonrpc/server.go View 1 2 chunks +15 lines, -0 lines 0 comments Download
M src/pkg/net/rpc/server.go View 1 3 chunks +21 lines, -3 lines 0 comments Download
M src/pkg/net/rpc/server_test.go View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 2
chai2010
Hello golang-dev@googlegroups.com, I'd like you to review this change to http://code.google.com/p/go
10 years, 9 months ago (2013-06-28 09:40:35 UTC) #1
rsc
10 years, 9 months ago (2013-07-01 22:54:50 UTC) #2
Thanks for looking into this, but I think this is probably best left out of the
standard library. It is still possible to write a wrapper that invokes rpc for
an existing connection by creating a codec, and there is no agreed-upon meaning
for "jsonrpc over http". Instead everyone seems to define their own slightly
different one. It's best to leave to third-party libraries.

Russ
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b