Skip to content

Commit c514cd1

Browse files
committed
Remove unnecessary example section
1 parent d95dc9c commit c514cd1

1 file changed

Lines changed: 0 additions & 29 deletions

File tree

pythonosc/osc_server.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,4 @@
11
"""OSC Servers that receive UDP packets and invoke handlers accordingly.
2-
3-
Use like this:
4-
5-
dispatcher = dispatcher.Dispatcher()
6-
# This will print all parameters to stdout.
7-
dispatcher.map("/bpm", print)
8-
server = ForkingOSCUDPServer((ip, port), dispatcher)
9-
server.serve_forever()
10-
11-
or run the server on its own thread:
12-
server = ForkingOSCUDPServer((ip, port), dispatcher)
13-
server_thread = threading.Thread(target=server.serve_forever)
14-
server_thread.start()
15-
...
16-
server.shutdown()
17-
18-
19-
Those servers are using the standard socketserver from the standard library:
20-
http://docs.python.org/library/socketserver.html
21-
22-
23-
Alternatively, the AsyncIOOSCUDPServer server can be integrated with an
24-
asyncio event loop:
25-
26-
loop = asyncio.get_event_loop()
27-
server = AsyncIOOSCUDPServer(server_address, dispatcher, loop)
28-
server.serve()
29-
loop.run_forever()
30-
312
"""
323

334
import asyncio

0 commit comments

Comments
 (0)