summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-02-27 04:57:58 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-02-27 04:57:58 +0700
commit24e30142aa51aa070e83e3c6b339662d5c038f12 (patch)
tree641450db4641262295a2d0126bef439f0333d322
parent23446011afef95c4e83cbce8dfec736831878563 (diff)
fake_trx/udp_link.py: set SO_REUSEADDR socket option
Setting this option allows one to reuse existing connections, for example, by injecting CTRL commands or DATA bursts into existing connections between fake_trx.py and trxcon. Change-Id: I0882c76affa9a668a12d10967081054d2b666ed1
-rw-r--r--src/target/fake_trx/udp_link.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/target/fake_trx/udp_link.py b/src/target/fake_trx/udp_link.py
index 7471b98e..c464802b 100644
--- a/src/target/fake_trx/udp_link.py
+++ b/src/target/fake_trx/udp_link.py
@@ -27,6 +27,7 @@ import socket
class UDPLink:
def __init__(self, remote_addr, remote_port, bind_port):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.sock.bind(('0.0.0.0', bind_port))
self.sock.setblocking(0)