You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your program is trying to make initiate TCP connections from the same local port. The only way to implement that with the sockets API is to bind the socket before making the connect call. Calling bind on the first socket will work, but calling bind on the second socket will fail, because the first socket is already bound to that port.
Closing because I don't see any way that Go could change to make this program work.
In general, if you have questions about using Go, please don't use the issue tracker. See the forums at https://golang.org/wiki/Questions.
What version of Go are you using (
go version
)?go version go1.8.3 linux/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/kmiura/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build271721950=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
tried to establish tcp connection.
Link on play.golang.org (https://play.golang.org/p/sOmgtkxQhx)
What did you expect to see?
Dialer.Dial succeeded in establishing connection on Ubuntu.
What did you see instead?
Dialer.Dial failed to establish connection with message "dial tcp :20->:8081: bind: address already in use".
The text was updated successfully, but these errors were encountered: