FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-osc/examples/simple_echo_server.py at main · fltodd/python-osc · GitHub
fltodd
/
python-osc
Public
forked from
attwad/python-osc
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-osc
/
examples
/
simple_echo_server.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (21 loc) · 858 Bytes
Breadcrumbs
python-osc
/
examples
/
simple_echo_server.py
Copy path
File metadata and controls
30 lines (21 loc) · 858 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""Small example OSC server
This program listens to several addresses, and prints some information about
received packets.
"""
import
argparse
import
math
from
pythonosc
.
dispatcher
import
Dispatcher
from
pythonosc
import
osc_server
def
echo_handler
(
client_addr
,
unused_addr
,
args
):
print
(
unused_addr
,
args
)
return
(
unused_addr
,
args
)
if
__name__
==
"__main__"
:
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"--ip"
,
default
=
"127.0.0.1"
,
help
=
"The ip to listen on"
)
parser
.
add_argument
(
"--port"
,
type
=
int
,
default
=
5005
,
help
=
"The port to listen on"
)
args
=
parser
.
parse_args
()
dispatcher
=
Dispatcher
()
dispatcher
.
set_default_handler
(
echo_handler
,
True
)
server
=
osc_server
.
ThreadingOSCUDPServer
((
args
.
ip
,
args
.
port
),
dispatcher
)
print
(
f"Serving on
{
server
.
server_address
}
"
)
server
.
serve_forever
()
Back
|
FazBrowse Home
|
New Git URL