FAQ
I've been hacking some RPC in Go recently.

I've found the following troublesome:
- setup rpc.Server with a given codec and custom path,
- setup connection to a server with codec.

No way to get connection because estabilshing is enclosed in Dial which
returns *rpc.Client

It may or not make sense to change rpc lib to include new function:

   func NewConnection(network, address, path string) (net.Conn, error)

Which would be just extracted connection extablishing from
rpc.DialHTTPPath. This would allow an easy creation of jsonrpc codec (and
others in future).

The other change I propose is modifying: rpc.Service to keep a codec
(factory?). Right now it uses rpc.gobServerCodec.

If any of the above is out of interest, can we at least make rpc.connected
variable exported?

Attaching my experiment file and Gist:
https://gist.github.com/orian/f766fdf561aae15997e3

I found Go libraries out-of-the-shelf solutions for many tasks and I think
this usecase could be easily added.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 13, '14 at 5:43p
activeOct 13, '14 at 5:43p
posts1
users1
websitegolang.org

1 user in discussion

Paweł S: 1 post

People

Translate

site design / logo © 2022 Grokbase