modes_sbs1: reuse socket

Otherwise you'd have to wait until it times out...

Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
Steve Markgraf 2012-05-31 23:59:30 +02:00 committed by Nick Foster
parent bb98eeaa97
commit f415257907

View File

@ -29,6 +29,7 @@ class modes_output_sbs1(modes_parse.modes_parse):
def __init__(self, mypos):
modes_parse.modes_parse.__init__(self, mypos)
self._s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self._s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self._s.bind(('', 30003))
self._s.listen(1)
self._s.setblocking(0) #nonblocking