servers: call recv late
This commit is contained in:
parent
62cd92e1cb
commit
28d4e507eb
@ -130,7 +130,7 @@ class AbstractServer:
|
|||||||
A list of fully received messages
|
A list of fully received messages
|
||||||
"""
|
"""
|
||||||
|
|
||||||
ret, self._readbuffer = self.lex(self._readbuffer + self._fd.read())
|
ret, self._readbuffer = self.lex(self._readbuffer + self.read())
|
||||||
|
|
||||||
for r in ret:
|
for r in ret:
|
||||||
yield r
|
yield r
|
||||||
|
@ -51,8 +51,8 @@ class _Socket(AbstractServer):
|
|||||||
|
|
||||||
# Read
|
# Read
|
||||||
|
|
||||||
def recv(self, *args, **kwargs):
|
def read(self, bufsize=1024, *args, **kwargs):
|
||||||
return self._fd.recv(*args, **kwargs)
|
return self._fd.recv(bufsize, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def parse(self, line):
|
def parse(self, line):
|
||||||
@ -115,10 +115,6 @@ class SocketClient(_Socket):
|
|||||||
super().__init__(fdClass=socket.socket, **kwargs)
|
super().__init__(fdClass=socket.socket, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def read(self):
|
|
||||||
return self._fd.recv()
|
|
||||||
|
|
||||||
|
|
||||||
class _Listener:
|
class _Listener:
|
||||||
|
|
||||||
def __init__(self, new_server_cb, instanciate=SocketClient, **kwargs):
|
def __init__(self, new_server_cb, instanciate=SocketClient, **kwargs):
|
||||||
|
Loading…
Reference in New Issue
Block a user