Add an 'outbound' field on each connection,

and only attempt new connections to the remote side of outbound connections.
This commit is contained in:
Bryan Boreham committed 2015-03-11 11:56:47 +00:00
1 parent 6f89ead9bd
commit 89fce7f98a
8 files changed
+26 -14

No files matched your search

+1 -1
View File
@@ -192,7 +192,7 @@ func (router *Router) acceptTCP(tcpConn *net.TCPConn) {
// start.
remoteAddrStr := tcpConn.RemoteAddr().String()
log.Printf("->[%s] connection accepted\n", remoteAddrStr)
connRemote := NewRemoteConnection(router.Ourself.Peer, nil, remoteAddrStr, false)
connRemote := NewRemoteConnection(router.Ourself.Peer, nil, remoteAddrStr, false, false)
connLocal := NewLocalConnection(connRemote, tcpConn, nil, router)
connLocal.Start(true)
}