-
Notifications
You must be signed in to change notification settings - Fork 117
Cant get Basic Server Demo to work with TouchOSC #131
Copy link
Copy link
Open
Description
Hi,
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels