Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/rpc: API #2944

Closed
rsc opened this issue Feb 9, 2012 · 4 comments
Closed

net/rpc: API #2944

rsc opened this issue Feb 9, 2012 · 4 comments
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Feb 9, 2012

In the overview, I am not sure what "exported or local" means, nor how the RPC
package can distinguish local from unexported-but-not-local.

I am not sure if the arg types need to be exported for reflect.  If you have a type t
(unexported), I don't know if reflect lets you reflect.New it.

There is no mention that struct fields need to be exported to be sent, at least in the
package doc.  In fact that's probably not a true restriction now that we have codecs.  A
custom codec could marshal and unmarshal types in its own package directly, without
using reflect, and thus access unexported fields.  Maybe reword a bit to make it clear
which restrictions are imposed by package rpc and which by the choice of codec.

There is at least one "gob" (in quotes) that should probably be gob; others
don't use quotes.

The package doc says Go returns a channel, but it returns a *Call.

The package doc talks about a restriction based on object type, but the restriction is
actually based on name (now that we have RegisterName, there's a difference).  Should
reword.

Not sure InvalidResult needs to be exported.  I can't see how a client or server would
ever see one.
Also, does the use of InvalidResult mean that if you try to call a function expecting,
say, *int as the
result, but you get an InvalidResult (a struct, not an int) back, gob will produce a
decode error?
@robpike
Copy link
Contributor

robpike commented Feb 11, 2012

Comment 1:

Owner changed to @robpike.

Status changed to Started.

@gopherbot
Copy link

Comment 2 by robpike:

notes to self:
can do reflect.New() of an unexported type, so that restriction can go
InvalidResult can probably be unexported, therefore, but the other question about it
needs analysis

@robpike
Copy link
Contributor

robpike commented Feb 28, 2012

Comment 3:

If the server sends InvalidRequest, there is an error and the client, after decoding the
error, discards the reply. It's ok, I believe.

@robpike
Copy link
Contributor

robpike commented Feb 28, 2012

Comment 4:

This issue was closed by revision 250fa82.

Status changed to Fixed.

@rsc rsc added fixed labels Feb 28, 2012
@rsc rsc added this to the Go1 milestone Apr 10, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc unassigned robpike Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants