Change in gr-gsm[master]: trx/udp_link.py: set SO_REUSEADDR socket option

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Piotr Krysik gerrit-no-reply at lists.osmocom.org
Fri Aug 10 09:46:18 UTC 2018


Piotr Krysik has submitted this change and it was merged. ( https://gerrit.osmocom.org/10422 )

Change subject: trx/udp_link.py: set SO_REUSEADDR socket option
......................................................................

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.

Cherry-picked from: I0882c76affa9a668a12d10967081054d2b666ed1
Change-Id: I6d256683a7aa0419cd5bd0a3eaa97aefdf3254f9
---
M python/trx/udp_link.py
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Piotr Krysik: Looks good to me, approved; Verified



diff --git a/python/trx/udp_link.py b/python/trx/udp_link.py
index cedcb1b..1fae8b4 100644
--- a/python/trx/udp_link.py
+++ b/python/trx/udp_link.py
@@ -28,6 +28,7 @@
 class udp_link:
 	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((remote_addr, bind_port))
 		self.sock.setblocking(0)
 

-- 
To view, visit https://gerrit.osmocom.org/10422
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: gr-gsm
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6d256683a7aa0419cd5bd0a3eaa97aefdf3254f9
Gerrit-Change-Number: 10422
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Piotr Krysik <ptrkrysik at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180810/9148dce3/attachment.htm>


More information about the gerrit-log mailing list