Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
multitouch
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
multitouch
Commits
9d8eeec9
Commit
9d8eeec9
authored
May 04, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made TUIO server more robust against stopping of the program.
parent
1aff9a2e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
src/tuio_server.py
src/tuio_server.py
+11
-4
No files found.
src/tuio_server.py
View file @
9d8eeec9
...
@@ -15,7 +15,7 @@ class TuioServer2D(Logger):
...
@@ -15,7 +15,7 @@ class TuioServer2D(Logger):
# OSC server that listens to incoming TUIO events
# OSC server that listens to incoming TUIO events
self
.
server
=
OSCServer
(
self
.
__class__
.
_tuio_address
)
self
.
server
=
OSCServer
(
self
.
__class__
.
_tuio_address
)
#
self.server.addDefaultHandlers()
self
.
server
.
addDefaultHandlers
()
self
.
server
.
addMsgHandler
(
'/tuio/2Dobj'
,
self
.
_receive
)
self
.
server
.
addMsgHandler
(
'/tuio/2Dobj'
,
self
.
_receive
)
self
.
server
.
addMsgHandler
(
'/tuio/2Dcur'
,
self
.
_receive
)
self
.
server
.
addMsgHandler
(
'/tuio/2Dcur'
,
self
.
_receive
)
self
.
server
.
addMsgHandler
(
'/tuio/2Dblb'
,
self
.
_receive
)
self
.
server
.
addMsgHandler
(
'/tuio/2Dblb'
,
self
.
_receive
)
...
@@ -67,8 +67,11 @@ class TuioServer2D(Logger):
...
@@ -67,8 +67,11 @@ class TuioServer2D(Logger):
self
.
handler_obj
.
point_down
(
sid
,
x
,
y
)
self
.
handler_obj
.
point_down
(
sid
,
x
,
y
)
def
start
(
self
):
def
start
(
self
):
try
:
self
.
log
(
'Starting OSC server'
)
self
.
log
(
'Starting OSC server'
)
self
.
server
.
serve_forever
()
self
.
server
.
serve_forever
()
except
SystemExit
:
self
.
stop
()
def
stop
(
self
):
def
stop
(
self
):
self
.
log
(
'Stopping OSC server'
)
self
.
log
(
'Stopping OSC server'
)
...
@@ -90,4 +93,8 @@ if __name__ == '__main__':
...
@@ -90,4 +93,8 @@ if __name__ == '__main__':
v
=
1
if
len
(
sys
.
argv
)
<
2
else
int
(
sys
.
argv
[
1
])
v
=
1
if
len
(
sys
.
argv
)
<
2
else
int
(
sys
.
argv
[
1
])
server
=
TuioServer2D
(
Handler
(
verbose
=
v
),
verbose
=
v
)
server
=
TuioServer2D
(
Handler
(
verbose
=
v
),
verbose
=
v
)
try
:
server
.
start
()
server
.
start
()
except
KeyboardInterrupt
:
server
.
stop
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment