TCP Client can't dial to server on localhost: network is unreachable.

704 views
Skip to first unread message

Константин Иванов

unread,
Sep 22, 2016, 1:42:00 PM9/22/16
to golang-nuts
Related to net package.

Code works fine on playground: https://play.golang.org/p/1fCIZzaUIT

But on local machine I've got (every time)

2016/09/22 20:37:30 listening on: 127.0.0.0:44327
2016/09/22 20:37:30 dialing
2016/09/22 20:37:30 dial error: dial tcp 127.0.0.0:44327: connect: network is unreachable


go version

go version go1.7.1 linux/amd64

What could it mean?

Константин Иванов

unread,
Sep 22, 2016, 3:00:24 PM9/22/16
to golang-nuts
uname -a
Linux hpg6 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Brad Fitzpatrick

unread,
Sep 22, 2016, 3:29:15 PM9/22/16
to Константин Иванов, golang-nuts
Use 127.0.0.1, not 127.0.0.0

The playground's net implementation is a toy and not very accurate.


--
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/d/optout.

Константин Иванов

unread,
Sep 22, 2016, 3:46:18 PM9/22/16
to golang-nuts, k-...@inbox.ru
Curse. I sprinkle ashes upon my head. That was a stupid mistake.

Yeah, 127.0.0.1 works fine. Thank you

четверг, 22 сентября 2016 г., 22:29:15 UTC+3 пользователь bradfitz написал:
Use 127.0.0.1, not 127.0.0.0

The playground's net implementation is a toy and not very accurate.

On Thu, Sep 22, 2016 at 10:41 AM, 'Константин Иванов' via golang-nuts <golan...@googlegroups.com> wrote:
Related to net package.

Code works fine on playground: https://play.golang.org/p/1fCIZzaUIT

But on local machine I've got (every time)

2016/09/22 20:37:30 listening on: 127.0.0.0:44327
2016/09/22 20:37:30 dialing
2016/09/22 20:37:30 dial error: dial tcp 127.0.0.0:44327: connect: network is unreachable


go version

go version go1.7.1 linux/amd64

What could it mean?

--
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages