parent
cba749088a
commit
a3a55e53c4
|
@ -69,7 +69,7 @@ class BMConnectionPool(object):
|
||||||
|
|
||||||
def removeConnection(self, connection):
|
def removeConnection(self, connection):
|
||||||
if isinstance(connection, network.udp.UDPSocket):
|
if isinstance(connection, network.udp.UDPSocket):
|
||||||
del self.udpSockets[connection.destination.host]
|
del self.udpSockets[connection.listening.host]
|
||||||
if isinstance(connection, network.tcp.TCPServer):
|
if isinstance(connection, network.tcp.TCPServer):
|
||||||
del self.listeningSockets[state.Peer(connection.destination.host, connection.destination.port)]
|
del self.listeningSockets[state.Peer(connection.destination.host, connection.destination.port)]
|
||||||
elif connection.isOutbound:
|
elif connection.isOutbound:
|
||||||
|
@ -109,7 +109,7 @@ class BMConnectionPool(object):
|
||||||
udpSocket = network.udp.UDPSocket(host=host)
|
udpSocket = network.udp.UDPSocket(host=host)
|
||||||
else:
|
else:
|
||||||
udpSocket = network.udp.UDPSocket(host=bind)
|
udpSocket = network.udp.UDPSocket(host=bind)
|
||||||
self.udpSockets[udpSocket.destination.host] = udpSocket
|
self.udpSockets[udpSocket.listening.host] = udpSocket
|
||||||
|
|
||||||
def loop(self):
|
def loop(self):
|
||||||
# defaults to empty loop if outbound connections are maxed
|
# defaults to empty loop if outbound connections are maxed
|
||||||
|
|
|
@ -65,6 +65,7 @@ class UDPSocket(BMProto):
|
||||||
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
|
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
self.listening = state.Peer(self.socket.getsockname()[0], self.socket.getsockname()[1])
|
||||||
self.destination = state.Peer(self.socket.getsockname()[0], self.socket.getsockname()[1])
|
self.destination = state.Peer(self.socket.getsockname()[0], self.socket.getsockname()[1])
|
||||||
ObjectTracker.__init__(self)
|
ObjectTracker.__init__(self)
|
||||||
self.connecting = False
|
self.connecting = False
|
||||||
|
|
Reference in New Issue
Block a user