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

New example for AddService (sum 2 numbers), and a failed example with TLS + AddService. #1

Closed
spikebike opened this issue Apr 4, 2012 · 0 comments

Comments

@spikebike
Copy link
Contributor

It's a bit complicated. First I have an unrelated server/client example that uses TLS:
https://gist.github.com/2233075

To test/run:
./mkcerts random@whatever.com
go run server.go

In another terminal:
go run client.go

Now a working example, much like your echo, just slightly more complicated:
https://gist.github.com/2300125

It compiles/runs just like go-rpcgen's echo.

Now I tried to merge the two:
https://gist.github.com/2300144

So basically I merged my TLS code and the Add Example code.

In add.go (the server) instead of calling ListenAndServeAddService with connection information I call NewAddServiceClient with my connection.

In client.go (the client) instead of calling DialAddService I call NewAddServiceClient with my connection.

I do wonder if my code that's mostly dealing with a TLS.conn is compatible with go-rpcgen code which seems to be expecting a net.conn.

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant