OSDN Git Service
(root)
/
bytom
/
vapor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
modify general config (#257)
[bytom/vapor.git]
/
p2p
/
listener_test.go
diff --git
a/p2p/listener_test.go
b/p2p/listener_test.go
index
bd2704b
..
c5c9a46
100644
(file)
--- a/
p2p/listener_test.go
+++ b/
p2p/listener_test.go
@@
-9,16
+9,15
@@
import (
func TestListener(t *testing.T) {
// Create a listener
func TestListener(t *testing.T) {
// Create a listener
- l, _ := NewDefaultListener("tcp", ":8001", true)
+ l, _ := NewDefaultListener("tcp", "
localhost
:8001", true)
// Dial the listener
// Dial the listener
- lAddr := l.
Ex
ternalAddress()
+ lAddr := l.
In
ternalAddress()
connOut, err := lAddr.Dial()
if err != nil {
t.Fatalf("Could not connect to listener address %v", lAddr)
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")
connIn, ok := <-l.Connections()
if !ok {
t.Fatalf("Could not get inbound connection from listener")