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, 3 insertions, 3 deletions
diff --git a/python/trx/udp_link.py b/python/trx/udp_link.py
index 675ef5c..cedcb1b 100644
--- a/python/trx/udp_link.py
+++ b/python/trx/udp_link.py
@@ -35,6 +35,9 @@ class udp_link:
self.remote_addr = remote_addr
self.remote_port = remote_port
+ def __del__(self):
+ self.sock.close()
+
def loop(self):
r_event, w_event, x_event = select.select([self.sock], [], [])
@@ -43,9 +46,6 @@ class udp_link:
data, addr = self.sock.recvfrom(128)
self.handle_rx(data.decode())
- def shutdown(self):
- self.sock.close();
-
def send(self, data):
if type(data) not in [bytearray, bytes]:
data = data.encode()