You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The listen method does not seem to change the current port. Please see below for a code snippet where I try to change a port with the changePort method. If defaut=True, I get this error:
RuntimeError: Only one default socket authorized! Please set default=False to other calls to listen()
And, if defaut=False, I just stop receiving messages on the port. Is this a sort of bug, or is there a right way to change port with OSCpy?
OS: macOS 12.6.6
Python: 3.9.16
OSCpy: 0.6.0
fromoscpy.serverimportOSCThreadServerSERVER_ADDRESS="127.0.0.1"PORT=3000OSC_ADDRESS=b"/testAddress"classOSCTest:
def__init__(self):
self.server=OSCThreadServer()
self.socket=self.server.listen(address=SERVER_ADDRESS,
port=PORT, default=True)
self.server.bind(OSC_ADDRESS, self.handler)
defhandler(self, *data):
print(data)
defclose(self):
self.server.stop(self.socket)
defchangePort(self, newPort):
"""Change the server port to a newPort."""# Close the current portself.server.stop(self.socket)
# Listen on the new portself.socket=self.server.listen(address=SERVER_ADDRESS,
port=newPort, default=False)
# Re-bind the server to handle incoming OSC messagesself.server.bind(OSC_ADDRESS, self.handler)
The text was updated successfully, but these errors were encountered:
The listen method does not seem to change the current port. Please see below for a code snippet where I try to change a port with the changePort method. If
defaut=True
, I get this error:RuntimeError: Only one default socket authorized! Please set default=False to other calls to listen()
And, if
defaut=False
, I just stop receiving messages on the port. Is this a sort of bug, or is there a right way to change port with OSCpy?OS: macOS 12.6.6
Python: 3.9.16
OSCpy: 0.6.0
The text was updated successfully, but these errors were encountered: