diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2018-08-10 00:20:03 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2018-08-10 16:38:59 +0700 |
commit | 473b35be863e240747ae3dfcc006d3a4eb4be619 (patch) | |
tree | e9d4fd39a56cb67e30021fe250dfec1efb8e45a9 /python/trx/udp_link.py | |
parent | 5394c6012d05d6565d1374e1c7a67b3f5f2decc6 (diff) |
apps/grgsm_trx: introduce bind address option
The new option (-b --bind-addr) allows one to specify the bind
address for both DATA and CTRL interfaces. By default, '0.0.0.0'
is used, so there are no restrictions for the L1 source address.
Change-Id: I3339f686b53db07cfd1bff9a516f4bdc28058cd9
Diffstat (limited to 'python/trx/udp_link.py')
-rw-r--r-- | python/trx/udp_link.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/trx/udp_link.py b/python/trx/udp_link.py index d96a6aa..efa701b 100644 --- a/python/trx/udp_link.py +++ b/python/trx/udp_link.py @@ -26,10 +26,10 @@ import socket import select class udp_link: - def __init__(self, remote_addr, remote_port, bind_port): + def __init__(self, remote_addr, remote_port, bind_addr = '0.0.0.0', bind_port = 0): 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.bind((bind_addr, bind_port)) self.sock.setblocking(0) # Save remote info |