diff --git a/server/ssocket.py b/server/ssocket.py index dfc69fca..f56f7199 100644 --- a/server/ssocket.py +++ b/server/ssocket.py @@ -68,7 +68,7 @@ class SSocket(Thread): #self.__ssock.bind(("localhost", 2222)) self.__ssock.bind(sock) # Become a server socket - self.__ssock.listen(5) + self.__ssock.listen(1) def run(self): self.__isRunning = True @@ -80,6 +80,9 @@ class SSocket(Thread): except socket.timeout: # Do nothing here pass + except socket.error: + # Do nothing here + pass self.__ssock.close() # Remove socket if os.path.exists(self.__socket): @@ -122,7 +125,7 @@ class SocketWorker(Thread): def __receive(sock): msg = '' while msg.rfind(SSocket.END_STRING) == -1: - chunk = sock.recv(6) + chunk = sock.recv(128) if chunk == '': raise RuntimeError, "socket connection broken" msg = msg + chunk