From 71edac14cfbd7710f0c7fa80911d0c5bf2e78505 Mon Sep 17 00:00:00 2001 From: 20kdc Date: Sun, 26 Mar 2023 19:03:51 +0100 Subject: [PATCH] Use sendto rather than connect to allow for cases where the server isn't running yet This is as part of an attempt on my part to connect MeFaMo to non-LiveLinkFace software, which may seem odd, but it looks like it has less issues than OpenSeeFace. --- mefamo/mefamo.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mefamo/mefamo.py b/mefamo/mefamo.py index 240b316..1063760 100644 --- a/mefamo/mefamo.py +++ b/mefamo/mefamo.py @@ -160,11 +160,10 @@ def start(self): def _network_loop(self): with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s: - s.connect((self.ip, self.upd_port)) while True: with self.lock: if self.got_new_data: - s.sendall(self.network_data) + s.sendto(self.network_data, (self.ip, self.upd_port)) self.got_new_data = False time.sleep(0.01)