fix graceful restart and add unit test

This commit is contained in:
clowwindy 2015-08-02 14:37:44 +08:00
parent e8b2946999
commit 111acf66c1
8 changed files with 121 additions and 9 deletions

13
tests/graceful_server.py Normal file
View file

@ -0,0 +1,13 @@
#!/usr/bin/python
import socket
if __name__ == '__main__':
s = socket.socket()
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(('127.0.0.1', 8001))
s.listen(1024)
c = None
while True:
c = s.accept()