3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

core: break attempts to read from a socket if no data is available

This commit is contained in:
James Lu 2018-05-18 19:08:37 -07:00
parent f87e646f35
commit 559b262db8

View File

@ -1774,6 +1774,10 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils):
"""
Message handler, called when select() has data to read.
"""
if self._socket is None:
log.debug('(%s) Ignoring attempt to read data because self._socket is None', self.name)
return
data = b''
try:
data = self._socket.recv(2048)