From 36949a845cf79e105445b9bc8656f2560469dc4d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Dec 2019 23:27:02 +0100 Subject: Fix network communication with Python bindings --- scripts/ingen.py | 11 ++++++----- wscript | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/ingen.py b/scripts/ingen.py index d56d7e0b..a9f2c4ed 100644 --- a/scripts/ingen.py +++ b/scripts/ingen.py @@ -156,11 +156,12 @@ class Remote(Interface): 'Read from socket until a null terminator is received' msg = u'' while True: - c = self.sock.recv(1, 0).decode('utf-8') - if not c or ord(c[0]) == 0: # End of transmission + chunk = self.sock.recv(1, 0) + if not chunk or chunk[0] == 0: # End of transmission break - else: - msg += c[0] + + msg += chunk.decode('utf-8') + return msg def blank_closure(self, graph, node): @@ -192,7 +193,7 @@ class Remote(Interface): msg = '\n'.join(msg) # Send message to server - self.sock.send(self.msgencode(msg)) + self.sock.send(self.msgencode(msg) + b'\0') # Receive response and parse into a model response_str = self._get_prefixes_string() + self.recv() diff --git a/wscript b/wscript index c23f9316..8ce958ef 100644 --- a/wscript +++ b/wscript @@ -69,7 +69,7 @@ def configure(conf): conf.check_pkg('suil-0 >= 0.8.7', uselib_store='SUIL') conf.check_pkg('sratom-0 >= 0.4.6', uselib_store='SRATOM') conf.check_pkg('raul-1 >= 1.0.0', uselib_store='RAUL') - conf.check_pkg('serd-0 >= 0.30.0', uselib_store='SERD', mandatory=False) + conf.check_pkg('serd-0 >= 0.30.3', uselib_store='SERD', mandatory=False) conf.check_pkg('sord-0 >= 0.12.0', uselib_store='SORD', mandatory=False) conf.check_pkg('portaudio-2.0', uselib_store='PORTAUDIO', mandatory=False) conf.check_pkg('sigc++-2.0', uselib_store='SIGCPP', mandatory=False) -- cgit v1.2.1