Browse Source

failsafe for session root blocking

master
Nils 5 years ago
parent
commit
0ae7a12b6b
  1. 20
      engine/nsmservercontrol.py

20
engine/nsmservercontrol.py

@ -566,14 +566,20 @@ class NsmServerControl(object):
self._setPause(True)
ready = False
while not ready:
data, addr = self.sock.recvfrom(1024)
msg = _IncomingMessage(data)
try:
data, addr = self.sock.recvfrom(1024)
msg = _IncomingMessage(data)
if msg.oscpath == "/nsm/gui/session/root":
sessionRoot = msg.params[0]
ready = True
else:
self._queue.append(msg)
if msg.oscpath == "/nsm/gui/session/root":
sessionRoot = msg.params[0]
ready = True
else:
self._queue.append(msg)
except BlockingIOError: #happens while no data is received. Has nothing to do with blocking or not.
continue
except socket.timeout:
continue
logger.info(f"Session root directory is {sessionRoot}")
self._setPause(False)

Loading…
Cancel
Save