From 24e30142aa51aa070e83e3c6b339662d5c038f12 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Tue, 27 Feb 2018 04:57:58 +0700 Subject: 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 --- src/target/fake_trx/udp_link.py | 1 + 1 file changed, 1 insertion(+) 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) -- cgit v1.2.3