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
I just used the following sample code to test the server with my TouchOSC Surface:
from pythonosc.dispatcher import Dispatcher
from pythonosc.osc_server import BlockingOSCUDPServer
def print_handler(address, *args):
print(f"{address}: {args}")
def default_handler(address, *args):
print(f"DEFAULT {address}: {args}")
dispatcher = Dispatcher()
dispatcher.map("/scene/*", print_handler)
dispatcher.set_default_handler(default_handler)
ip = "127.0.0.1"
port = 8006
server = BlockingOSCUDPServer((ip, port), dispatcher)
server.serve_forever() # Blocks forever
TouchOSC sends to port 8006 and receives on port 9006.
Sending messages to TouchOSC works nicely but the server does not give any output.
Regardless what I set as the address used by the dispatcher.
Neither the function to handle the set mapping nor the default handler seem to be called.
PyCharm gives two warnings for the disptcher calls: Expected type 'FunctionType', got '(address: Any, args: Tuple[Any, ...]) -> None' instead
May that be a hint what is wrong?
Im running that code on Windows10 Pro using PyCharm.
What am I doing wrong here?
Cheers
Harlekin
The text was updated successfully, but these errors were encountered:
Hi,
I just used the following sample code to test the server with my TouchOSC Surface:
TouchOSC sends to port 8006 and receives on port 9006.
Sending messages to TouchOSC works nicely but the server does not give any output.
Regardless what I set as the address used by the dispatcher.
Neither the function to handle the set mapping nor the default handler seem to be called.
PyCharm gives two warnings for the disptcher calls:
Expected type 'FunctionType', got '(address: Any, args: Tuple[Any, ...]) -> None' instead
May that be a hint what is wrong?
Im running that code on Windows10 Pro using PyCharm.
What am I doing wrong here?
Cheers
Harlekin
The text was updated successfully, but these errors were encountered: