3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +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. 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'' data = b''
try: try:
data = self._socket.recv(2048) data = self._socket.recv(2048)