Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
kebiao committed Feb 13, 2019
1 parent 1e3abfb commit eed43b4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/interface/Poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,16 @@ def onRecv(self, fileno):
return

data = sock.recv(2048)

if len(data) == 0:
DEBUG_MSG("Poller::onRecv: %s/%i disconnect!" % (addr, sock.fileno()))
KBEngine.deregisterReadFileDescriptor(sock.fileno())
sock.close()
del self._clients[fileno]
return

DEBUG_MSG("Poller::onRecv: %s/%i get data, size=%i" % (addr, sock.fileno(), len(data)))
self.processData(sock, data)
KBEngine.deregisterReadFileDescriptor(sock.fileno())
sock.close()
del self._clients[fileno]

def processData(self, sock, datas):
"""
Expand Down

0 comments on commit eed43b4

Please sign in to comment.