From 7d51bbe6161dcb8f32a1252c27668ce36e3ef16b Mon Sep 17 00:00:00 2001 From: Ugorji Nwoke Date: Thu, 28 Jun 2018 06:27:55 -0400 Subject: [PATCH] codec: rpc tests should listen on ipv4 localhost only. 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 --- codec/codec_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codec/codec_test.go b/codec/codec_test.go index d02feacd..5a4bec2f 100644 --- a/codec/codec_test.go +++ b/codec/codec_test.go @@ -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