Skip to content

Commit

Permalink
codec: rpc tests should listen on ipv4 localhost only.
Browse files Browse the repository at this point in the history
This ensures that
- net.Dial works just fine on go 1.7 and 1.8
- firewall concerns do not come up, because the server is
  listening for connections outside local machine

Updates #247
- with aim to revert the PR
  • Loading branch information
ugorji committed Jun 28, 2018
1 parent be38b70 commit 7d51bbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion codec/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,8 @@ func testCodecRpcOne(t *testing.T, rr Rpc, h Handle, doRequest bool, exitSleepMs
}
srv := rpc.NewServer()
srv.Register(testRpcInt)
ln, err := net.Listen("tcp", ":0")
ln, err := net.Listen("tcp", "127.0.0.1:0") // listen on ipv4 localhost
logT(t, "connFn: addr: %v, network: %v, port: %v", ln.Addr(), ln.Addr().Network(), (ln.Addr().(*net.TCPAddr)).Port)
// log("listener: %v", ln.Addr())
checkErrT(t, err)
port = (ln.Addr().(*net.TCPAddr)).Port
Expand Down

0 comments on commit 7d51bbe

Please sign in to comment.