[go-nuts] Server / Client applications

18 views
Skip to first unread message

John

unread,
May 14, 2010, 12:50:10 AM5/14/10
to golang-nuts
Are there code samples available (or tutorials) about how to create a
simple server and client?

Also, how do we know what port the server runs on? Say we want a
server with multiple clients, and the server multiplexes the
communication and responds on the appropriate channel. I've seen code
sorta like this, BUT I didn't see anything about what port the server
is running over or how to check that.

Any information would be appreciated.

John

StepLg

unread,
May 14, 2010, 3:06:24 AM5/14/10
to golang-nuts
Try to look at net package: http://golang.org/pkg/net/

roger peppe

unread,
May 14, 2010, 3:29:41 AM5/14/10
to StepLg, golang-nuts
there's also the rpc package (http://golang.org/pkg/rpc/)
which works at a somewhat higher level than net,
and includes some example code.

John

unread,
May 14, 2010, 11:32:03 AM5/14/10
to golang-nuts
Thanks guys, I think that's exactly what I was looking for. I don't
know how i missed that (especially the RPC package).

I'll test it out later. :)

John
> >> John- Hide quoted text -
>
> - Show quoted text -

Michael Hoisie

unread,
May 14, 2010, 2:42:34 PM5/14/10
to golang-nuts
I'm late to the party, but here's a small example of an echo client
and server:

http://pastie.org/960703

- Mike
Reply all
Reply to author
Forward
0 new messages