server: make sure accepted UNIX sockets are blocking

It was a problem on Mac OS X, where sometimes we got EAGAIN
errors from calling socket.recv() on them.
This commit is contained in:
Roman Zeyde
2016-01-18 22:49:27 +02:00
parent b101281a5b
commit 9afd07e867
2 changed files with 4 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ def server_thread(server, handler, quit_event):
def accept_connection():
conn, _ = server.accept()
conn.settimeout(None)
return conn
while True:

View File

@@ -32,6 +32,9 @@ class FakeSocket(object):
def close(self):
pass
def settimeout(self, value):
pass
def test_handle():
handler = protocol.Handler(keys=[], signer=None)