]> jspc29.x-matter.uni-frankfurt.de Git - labtools.git/commitdiff
opus20 fakeserver: SO_REUSEADDR for faster restart
authorPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Mon, 14 Aug 2017 11:21:45 +0000 (13:21 +0200)
committerPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Mon, 14 Aug 2017 11:21:45 +0000 (13:21 +0200)
opus20/opus20/fakeserver.py

index 4b06b8e2ba66e2b35b0dd58feba28e13b0a43a15..3c833ddcbec652c65597a6155b1667b37574bec2 100644 (file)
@@ -17,6 +17,7 @@ class Opus20FakeServer(object):
 
     def bind_and_serve(self):
         self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+        self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
         self.s.bind((self.host, self.port))
         self.s.listen(1)
         try: