3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

IRCNetwork: only register a socket with selectdriver after connecting

This commit is contained in:
James Lu 2018-03-23 20:16:29 -07:00
parent ec8f744449
commit 814dd9a3c5

View File

@ -1386,10 +1386,10 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils):
self._socket = context.wrap_socket(self._socket)
self._selector_key = selectdriver.register(self)
log.info("Connecting to network %r on %s:%s", self.name, ip, port)
self._socket.connect((ip, port))
self._socket.settimeout(self.pingtimeout)
self._selector_key = selectdriver.register(self)
# If SSL was enabled, optionally verify the certificate
# fingerprint for some added security. I don't bother to check