Commit ed15bd03 authored by froehlich martin - mfroehli's avatar froehlich martin - mfroehli
Browse files

Update udp_one2manymo.py to sockets with resuable address

parent b78ac0a0
......@@ -25,12 +25,14 @@ class One2ManyMoProxy(multiprocessing.Process):
raise ValueError('Specified port "%s" is invalid.' % port)
try:
self.source = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.source.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.source.settimeout(0.1)
self.source.bind((listen_address, listen_port))
except socket.error as msg:
raise
try:
self.sink = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.sink.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
# Make socket non-blocking by setting timeout to 0
self.sink.settimeout(0)
self.sink.bind((listen_address, send_port))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment