aboutsummaryrefslogtreecommitdiffstats
path: root/python/trx/udp_link.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/trx/udp_link.py')
-rw-r--r--python/trx/udp_link.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/trx/udp_link.py b/python/trx/udp_link.py
index efa701b..ad84e5a 100644
--- a/python/trx/udp_link.py
+++ b/python/trx/udp_link.py
@@ -47,6 +47,12 @@ class udp_link:
data, addr = self.sock.recvfrom(128)
self.handle_rx(data.decode(), addr)
+ def desc_link(self):
+ (bind_addr, bind_port) = self.sock.getsockname()
+
+ return "L:%s:%u <-> R:%s:%u" \
+ % (bind_addr, bind_port, self.remote_addr, self.remote_port)
+
def send(self, data, remote = None):
if type(data) not in [bytearray, bytes]:
data = data.encode()