FAQ
How to create unified client and server code working in:

1) same machine: Unix domain socket
2) different machines: tcp

--Constantine



--
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/groups/opt_out.

Search Discussions

  • Alex at Oct 12, 2013 at 7:56 pm
    You're going to have to either ask more targeted questions about where
    you're stuck, and/or post a valiant effort I think before more people will
    be willing to help you on this list.

    There are tons of client/server examples out on the internet - just search
    for them (ex. golang tcp server client).

    As a nudge(and, in case this shows up in a search result one day) , here's
    the documentation for the net package which includes a full tcp listener
    example - http://golang.org/pkg/net/

    Here's some discussion AND code for unix sockets -
    http://stackoverflow.com/questions/2886719/unix-sockets-in-go

    Good luck, and post back if you have any questions after you've given it a
    shot.

    Regards,
    Alex

    On Saturday, October 12, 2013 3:10:16 PM UTC-4, Constantine Vasil wrote:

    How to create unified client and server code working in:

    1) same machine: Unix domain socket
    2) different machines: tcp

    --Constantine

    --
    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/groups/opt_out.
  • Constantine Vasil at Oct 12, 2013 at 8:39 pm
    Alex,

    Thank you for your help.

    I have experience with tcp but don't have any with Unix domain sockets.

    --Constantine
    On Saturday, October 12, 2013 12:56:19 PM UTC-7, al...@lx.lc wrote:

    You're going to have to either ask more targeted questions about where
    you're stuck, and/or post a valiant effort I think before more people will
    be willing to help you on this list.

    There are tons of client/server examples out on the internet - just search
    for them (ex. golang tcp server client).

    As a nudge(and, in case this shows up in a search result one day) , here's
    the documentation for the net package which includes a full tcp listener
    example - http://golang.org/pkg/net/

    Here's some discussion AND code for unix sockets -
    http://stackoverflow.com/questions/2886719/unix-sockets-in-go

    Good luck, and post back if you have any questions after you've given it a
    shot.

    Regards,
    Alex

    On Saturday, October 12, 2013 3:10:16 PM UTC-4, Constantine Vasil wrote:

    How to create unified client and server code working in:

    1) same machine: Unix domain socket
    2) different machines: tcp

    --Constantine

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/8b2f8626-70c5-4b90-aa34-53d4ae50a446%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Constantine Vasil at Oct 12, 2013 at 9:40 pm
    On the server:
    ListenType := "unix"
    ListenAddr := "/tmp/MyCall.sock"
    ln, err := net.Listen(ListenType, ListenAddr)

    On the client:
    c, err := net.Dial(ListenType, address)

    Got the message:
    address already in use

    On Saturday, October 12, 2013 1:39:25 PM UTC-7, Constantine Vasil wrote:

    Alex,

    Thank you for your help.

    I have experience with tcp but don't have any with Unix domain sockets.

    --Constantine
    On Saturday, October 12, 2013 12:56:19 PM UTC-7, al...@lx.lc wrote:

    You're going to have to either ask more targeted questions about where
    you're stuck, and/or post a valiant effort I think before more people will
    be willing to help you on this list.

    There are tons of client/server examples out on the internet - just
    search for them (ex. golang tcp server client).

    As a nudge(and, in case this shows up in a search result one day) ,
    here's the documentation for the net package which includes a full tcp
    listener example - http://golang.org/pkg/net/

    Here's some discussion AND code for unix sockets -
    http://stackoverflow.com/questions/2886719/unix-sockets-in-go

    Good luck, and post back if you have any questions after you've given it
    a shot.

    Regards,
    Alex

    On Saturday, October 12, 2013 3:10:16 PM UTC-4, Constantine Vasil wrote:

    How to create unified client and server code working in:

    1) same machine: Unix domain socket
    2) different machines: tcp

    --Constantine

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/5b66bad7-3b23-4511-bba7-22d13ab3c57b%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Constantine Vasil at Oct 12, 2013 at 10:01 pm
    Alex,

    I gave it a shot and as I suspected it is not working because the link is
    too old.
    Here's some discussion AND code for unix sockets -
    http://stackoverflow.com/questions/2886719/unix-sockets-in-go
    is from Jan 21 '11 at 13:21

    this does not compile:
    c, err := net.Dial(ListenType, "", address)
    error: too many arguments

    --Constantine
    On Saturday, October 12, 2013 2:40:39 PM UTC-7, Constantine Vasil wrote:

    On the server:
    ListenType := "unix"
    ListenAddr := "/tmp/MyCall.sock"
    ln, err := net.Listen(ListenType, ListenAddr)

    On the client:
    c, err := net.Dial(ListenType, address)

    Got the message:
    address already in use

    On Saturday, October 12, 2013 1:39:25 PM UTC-7, Constantine Vasil wrote:

    Alex,

    Thank you for your help.

    I have experience with tcp but don't have any with Unix domain sockets.

    --Constantine
    On Saturday, October 12, 2013 12:56:19 PM UTC-7, al...@lx.lc wrote:

    You're going to have to either ask more targeted questions about where
    you're stuck, and/or post a valiant effort I think before more people will
    be willing to help you on this list.

    There are tons of client/server examples out on the internet - just
    search for them (ex. golang tcp server client).

    As a nudge(and, in case this shows up in a search result one day) ,
    here's the documentation for the net package which includes a full tcp
    listener example - http://golang.org/pkg/net/

    Here's some discussion AND code for unix sockets -
    http://stackoverflow.com/questions/2886719/unix-sockets-in-go

    Good luck, and post back if you have any questions after you've given it
    a shot.

    Regards,
    Alex

    On Saturday, October 12, 2013 3:10:16 PM UTC-4, Constantine Vasil wrote:

    How to create unified client and server code working in:

    1) same machine: Unix domain socket
    2) different machines: tcp

    --Constantine

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/7de3f1ae-b2fc-470e-85d2-a3ec04433dfe%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Alex at Oct 12, 2013 at 10:11 pm
    Just remove the middle argument. There are a few other nuances -
    err.String() should be err.Error(), but otherwise, the code in the first
    answer there works fine.

    Regards,
    Alex
    On Saturday, October 12, 2013 6:01:32 PM UTC-4, Constantine Vasil wrote:

    Alex,

    I gave it a shot and as I suspected it is not working because the link is
    too old.
    Here's some discussion AND code for unix sockets -
    http://stackoverflow.com/questions/2886719/unix-sockets-in-go
    is from Jan 21 '11 at 13:21

    this does not compile:
    c, err := net.Dial(ListenType, "", address)
    error: too many arguments

    --Constantine
    On Saturday, October 12, 2013 2:40:39 PM UTC-7, Constantine Vasil wrote:

    On the server:
    ListenType := "unix"
    ListenAddr := "/tmp/MyCall.sock"
    ln, err := net.Listen(ListenType, ListenAddr)

    On the client:
    c, err := net.Dial(ListenType, address)

    Got the message:
    address already in use

    On Saturday, October 12, 2013 1:39:25 PM UTC-7, Constantine Vasil wrote:

    Alex,

    Thank you for your help.

    I have experience with tcp but don't have any with Unix domain sockets.

    --Constantine
    On Saturday, October 12, 2013 12:56:19 PM UTC-7, al...@lx.lc wrote:

    You're going to have to either ask more targeted questions about where
    you're stuck, and/or post a valiant effort I think before more people will
    be willing to help you on this list.

    There are tons of client/server examples out on the internet - just
    search for them (ex. golang tcp server client).

    As a nudge(and, in case this shows up in a search result one day) ,
    here's the documentation for the net package which includes a full tcp
    listener example - http://golang.org/pkg/net/

    Here's some discussion AND code for unix sockets -
    http://stackoverflow.com/questions/2886719/unix-sockets-in-go

    Good luck, and post back if you have any questions after you've given
    it a shot.

    Regards,
    Alex

    On Saturday, October 12, 2013 3:10:16 PM UTC-4, Constantine Vasil wrote:

    How to create unified client and server code working in:

    1) same machine: Unix domain socket
    2) different machines: tcp

    --Constantine

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/56659114-de4c-435a-b30f-27ce6b6bcd78%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Constantine Vasil at Oct 12, 2013 at 10:14 pm
    Got the message:
    address already in use
    On Saturday, October 12, 2013 3:11:05 PM UTC-7, al...@lx.lc wrote:

    Just remove the middle argument. There are a few other nuances -
    err.String() should be err.Error(), but otherwise, the code in the first
    answer there works fine.

    Regards,
    Alex
    On Saturday, October 12, 2013 6:01:32 PM UTC-4, Constantine Vasil wrote:

    Alex,

    I gave it a shot and as I suspected it is not working because the link is
    too old.
    Here's some discussion AND code for unix sockets -
    http://stackoverflow.com/questions/2886719/unix-sockets-in-go
    is from Jan 21 '11 at 13:21

    this does not compile:
    c, err := net.Dial(ListenType, "", address)
    error: too many arguments

    --Constantine
    On Saturday, October 12, 2013 2:40:39 PM UTC-7, Constantine Vasil wrote:

    On the server:
    ListenType := "unix"
    ListenAddr := "/tmp/MyCall.sock"
    ln, err := net.Listen(ListenType, ListenAddr)

    On the client:
    c, err := net.Dial(ListenType, address)

    Got the message:
    address already in use

    On Saturday, October 12, 2013 1:39:25 PM UTC-7, Constantine Vasil wrote:

    Alex,

    Thank you for your help.

    I have experience with tcp but don't have any with Unix domain sockets.

    --Constantine
    On Saturday, October 12, 2013 12:56:19 PM UTC-7, al...@lx.lc wrote:

    You're going to have to either ask more targeted questions about where
    you're stuck, and/or post a valiant effort I think before more people will
    be willing to help you on this list.

    There are tons of client/server examples out on the internet - just
    search for them (ex. golang tcp server client).

    As a nudge(and, in case this shows up in a search result one day) ,
    here's the documentation for the net package which includes a full tcp
    listener example - http://golang.org/pkg/net/

    Here's some discussion AND code for unix sockets -
    http://stackoverflow.com/questions/2886719/unix-sockets-in-go

    Good luck, and post back if you have any questions after you've given
    it a shot.

    Regards,
    Alex


    On Saturday, October 12, 2013 3:10:16 PM UTC-4, Constantine Vasil
    wrote:
    How to create unified client and server code working in:

    1) same machine: Unix domain socket
    2) different machines: tcp

    --Constantine

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/c67e5038-2f46-4a86-80d1-fdef9527f660%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Alex at Oct 12, 2013 at 10:19 pm
    Because the file exists. Remove the file manually, then make your server
    clean it up properly upon exit.

    Thanks,
    Alex
    On Saturday, October 12, 2013 6:14:20 PM UTC-4, Constantine Vasil wrote:

    Got the message:
    address already in use
    On Saturday, October 12, 2013 3:11:05 PM UTC-7, al...@lx.lc wrote:

    Just remove the middle argument. There are a few other nuances -
    err.String() should be err.Error(), but otherwise, the code in the first
    answer there works fine.

    Regards,
    Alex
    On Saturday, October 12, 2013 6:01:32 PM UTC-4, Constantine Vasil wrote:

    Alex,

    I gave it a shot and as I suspected it is not working because the link
    is too old.
    Here's some discussion AND code for unix sockets -
    http://stackoverflow.com/questions/2886719/unix-sockets-in-go
    is from Jan 21 '11 at 13:21

    this does not compile:
    c, err := net.Dial(ListenType, "", address)
    error: too many arguments

    --Constantine
    On Saturday, October 12, 2013 2:40:39 PM UTC-7, Constantine Vasil wrote:

    On the server:
    ListenType := "unix"
    ListenAddr := "/tmp/MyCall.sock"
    ln, err := net.Listen(ListenType, ListenAddr)

    On the client:
    c, err := net.Dial(ListenType, address)

    Got the message:
    address already in use

    On Saturday, October 12, 2013 1:39:25 PM UTC-7, Constantine Vasil wrote:

    Alex,

    Thank you for your help.

    I have experience with tcp but don't have any with Unix domain
    sockets.

    --Constantine
    On Saturday, October 12, 2013 12:56:19 PM UTC-7, al...@lx.lc wrote:

    You're going to have to either ask more targeted questions about
    where you're stuck, and/or post a valiant effort I think before more people
    will be willing to help you on this list.

    There are tons of client/server examples out on the internet - just
    search for them (ex. golang tcp server client).

    As a nudge(and, in case this shows up in a search result one day) ,
    here's the documentation for the net package which includes a full tcp
    listener example - http://golang.org/pkg/net/

    Here's some discussion AND code for unix sockets -
    http://stackoverflow.com/questions/2886719/unix-sockets-in-go

    Good luck, and post back if you have any questions after you've given
    it a shot.

    Regards,
    Alex


    On Saturday, October 12, 2013 3:10:16 PM UTC-4, Constantine Vasil
    wrote:
    How to create unified client and server code working in:

    1) same machine: Unix domain socket
    2) different machines: tcp

    --Constantine

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/375404e9-707e-4ef0-8c2b-784f58d022ec%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • DisposaBoy at Oct 14, 2013 at 1:12 pm
    just put an at sign in front of the.path. e.g. @/tmp/... and or will be automatically cleaned up for you

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/9b3f18a1-9c1a-4dd3-adf0-7e67846a6c8c%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Constantine Vasil at Oct 14, 2013 at 3:07 pm
    The file was created automatically
    On Saturday, October 12, 2013 3:19:22 PM UTC-7, al...@lx.lc wrote:

    Because the file exists. Remove the file manually, then make your server
    clean it up properly upon exit.

    Thanks,
    Alex
    On Saturday, October 12, 2013 6:14:20 PM UTC-4, Constantine Vasil wrote:

    Got the message:
    address already in use
    On Saturday, October 12, 2013 3:11:05 PM UTC-7, al...@lx.lc wrote:

    Just remove the middle argument. There are a few other nuances -
    err.String() should be err.Error(), but otherwise, the code in the first
    answer there works fine.

    Regards,
    Alex
    On Saturday, October 12, 2013 6:01:32 PM UTC-4, Constantine Vasil wrote:

    Alex,

    I gave it a shot and as I suspected it is not working because the link
    is too old.
    Here's some discussion AND code for unix sockets -
    http://stackoverflow.com/questions/2886719/unix-sockets-in-go
    is from Jan 21 '11 at 13:21

    this does not compile:
    c, err := net.Dial(ListenType, "", address)
    error: too many arguments

    --Constantine
    On Saturday, October 12, 2013 2:40:39 PM UTC-7, Constantine Vasil wrote:

    On the server:
    ListenType := "unix"
    ListenAddr := "/tmp/MyCall.sock"
    ln, err := net.Listen(ListenType, ListenAddr)

    On the client:
    c, err := net.Dial(ListenType, address)

    Got the message:
    address already in use


    On Saturday, October 12, 2013 1:39:25 PM UTC-7, Constantine Vasil
    wrote:
    Alex,

    Thank you for your help.

    I have experience with tcp but don't have any with Unix domain
    sockets.

    --Constantine
    On Saturday, October 12, 2013 12:56:19 PM UTC-7, al...@lx.lc wrote:

    You're going to have to either ask more targeted questions about
    where you're stuck, and/or post a valiant effort I think before more people
    will be willing to help you on this list.

    There are tons of client/server examples out on the internet - just
    search for them (ex. golang tcp server client).

    As a nudge(and, in case this shows up in a search result one day) ,
    here's the documentation for the net package which includes a full tcp
    listener example - http://golang.org/pkg/net/

    Here's some discussion AND code for unix sockets -
    http://stackoverflow.com/questions/2886719/unix-sockets-in-go

    Good luck, and post back if you have any questions after you've
    given it a shot.

    Regards,
    Alex


    On Saturday, October 12, 2013 3:10:16 PM UTC-4, Constantine Vasil
    wrote:
    How to create unified client and server code working in:

    1) same machine: Unix domain socket
    2) different machines: tcp

    --Constantine

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/b5797bed-a03c-44e1-bf68-be46b1b5f7c5%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 12, '13 at 7:10p
activeOct 14, '13 at 3:07p
posts10
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase