X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=p2p%2Flistener_test.go;h=c5c9a462ea26576bfca2d8041b0b0f34b7c88660;hb=b9175a5cd6c0fe90429c65cb5f7112e6845cb6c0;hp=bd2704b4dbb3678b9f24244477006d3f2f2c709c;hpb=08281341c2cb02ba11d4218576256688854790fc;p=bytom%2Fvapor.git diff --git a/p2p/listener_test.go b/p2p/listener_test.go index bd2704b4..c5c9a462 100644 --- a/p2p/listener_test.go +++ b/p2p/listener_test.go @@ -9,16 +9,15 @@ import ( func TestListener(t *testing.T) { // Create a listener - l, _ := NewDefaultListener("tcp", ":8001", true) + l, _ := NewDefaultListener("tcp", "localhost:8001", true) // Dial the listener - lAddr := l.ExternalAddress() + lAddr := l.InternalAddress() connOut, err := lAddr.Dial() if err != nil { t.Fatalf("Could not connect to listener address %v", lAddr) - } else { - t.Logf("Created a connection to listener address %v", lAddr) } + connIn, ok := <-l.Connections() if !ok { t.Fatalf("Could not get inbound connection from listener")