-
Notifications
You must be signed in to change notification settings - Fork 101
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
How to coordinate physically seperate servers and clients #26
Comments
Oddly much further in my development project, and just had this issue come up again. My code seems to be working despite it, which is a bit puzzling. In this case, its occuring when I make an RPC call to the public IP from the the box that is serving the port. 2017/04/10 21:51:47 gorpc.Server: [66.128.118.34:56796]->[:1958]. Error when reading handshake from client: [EOF] Where 66.128.118.34 is the public IP address of the machine itself. Will update when I figure this out. |
Hmmm, out of ideas. Fortunately the code snippets are fairly short.
Receiving code:
And the handling function definitions themselves:
Which generate the above error when running, but otherwise appear to be working just fine. Any suggestions would be greatly appreciated. |
I'm sure I'm missing something extremely trivial here, but am stuck. I'd like to implement a server on one computer that has a registered service, call it "Ping", that can be called from a client on another server and respond with "Pong".
Per https://godoc.org/github.com/valyala/gorpc#example-Dispatcher--FuncCalls the client wrapper is established as
dc := d.NewFuncClient(c)
.My concern is that
d
is not defined in a client only applet.If I reference the NewTCPClient directly, with a call like
c.Call("Ping")
the server will error out with:gorpc.Dispatcher: unsupported request type received from the client: string
Obviously I'm missing something basic, please clue me in.
Server side pseudo code:
Client side pseudo code:
I've also tried:
Which results in a " Error when reading handshake from client: [EOF]" error since no d.AddFunc() has been called.
My brain is having problems groking that the client code would need any details beyond a function name that the server handles.
I did find that if I used the 2nd approach and added a
d.AddFunc("Ping", func() {})
prior to thedc
assignment it works.Really not clear if that is the right way though or if I just hacked it... Comments please.
The text was updated successfully, but these errors were encountered: