rpc.StartHTTPServer listener bug fix

This commit is contained in:
Jae Kwon
2015-04-23 18:33:20 -07:00
parent 66ff985cd2
commit d9bfe82d93
6 changed files with 17 additions and 19 deletions
+2
View File
@@ -137,6 +137,8 @@ func (l *DefaultListener) ExternalAddress() *NetAddress {
return l.extAddr
}
// NOTE: The returned listener is already Accept()'ing.
// So it's not suitable to pass into http.Serve().
func (l *DefaultListener) NetListener() net.Listener {
return l.listener
}
+2
View File
@@ -77,11 +77,13 @@ func makeSwitchPair(t testing.TB, initSwitch func(*Switch) *Switch) (*Switch, *S
s1.SetNodeInfo(&types.NodeInfo{
Moniker: "switch1",
Network: "testing",
Version: "123.123.123",
})
s2 := initSwitch(NewSwitch())
s2.SetNodeInfo(&types.NodeInfo{
Moniker: "switch2",
Network: "testing",
Version: "123.123.123",
})
// Start switches