Skip to content

Commit 6ad2c92

Browse files
committed
PythonCLI: enable SO_REUSEADDR for data socket
1 parent 2a18339 commit 6ad2c92

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

PythonCLI/gree.py

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def __init__(self, ip, port, id, name=''):
2525
def send_data(ip, port, data):
2626
s = socket.socket(type=socket.SOCK_DGRAM, proto=socket.IPPROTO_UDP)
2727
s.settimeout(5)
28+
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
2829
s.sendto(data, (ip, port))
2930
return s.recv(1024)
3031

0 commit comments

Comments
 (0)