1 of 9
1
TUIO tcp proxy
Posted: 23 May 2008 09:28 AM   [ Ignore ]
Avatar
RankRank
Joined  2008-03-02
Total Posts:  107
Member

I have just released a quick write of a tuio proxying server.
What it does ?
It accepts udp messages on specified port and then forwards them to tcp port of your choice.
The code as well the precompiled binaries for window/linux are available on google code:

precompiled binaries:
http://code.google.com/p/tuio-tcp-proxy/downloads/list

code:
http://code.google.com/p/tuio-tcp-proxy/source/browse

To run server accepting messages from udp 3333 and forward them to tcp 3000:

toxy.exe -p 3333 -t 3000

open another dos window and run tuio dump to debug (it will forward all the messages to console):

toxy_dump.exe

If toxy.exe is run just with -d it will give debug output (if started without ports it will default to 3333 - 3000)
In the zip is also toxy_win (nice frontend with tray icon and no console)

Binnary socket AS3 implementation writen by weyforth can be found on the google code svn repository also.

Updated toxy suite (toxy console, toxy debuging and toxy from tray):

Latest version of toxy tray is on bottom (this is official 1.2 version)
It has automatic starting of osc with hidden console window *you need to configure that in config dialog
After any changes in the configuration you need to restart the app.

File Attachments
toxy_win.zip  (File Size: 52KB - Downloads: 711)
toxy_win-1.2.zip  (File Size: 29KB - Downloads: 689)
Profile
 
 
Posted: 23 May 2008 09:57 AM   [ Ignore ]   [ # 1 ]
Avatar
RankRank
Joined  2007-04-03
Total Posts:  241
Moderator

just wondering jet-plane, whats the advantage of this tuio proxy over the flosc which is available from: http://touchlib.googlecode.com/svn/trunk/AS3/src/deploy/flosc/FlashOSCv2_0_4.jar ?

 Signature 

My multitouch blog: http://www.multigesture.net
Howto: Compile touchlib on windows XP/Vista
Howto: Compile touchlib on Ubuntu Linux
Downloads: Touchlib SVN builds

Profile
 
 
Posted: 23 May 2008 10:06 AM   [ Ignore ]   [ # 2 ]
Avatar
RankRank
Joined  2008-03-02
Total Posts:  107
Member

For one flosc, as I recall, is xml socket based flash connection. And this app is just
forwarding udp to tcp binary socket with no modification on original message.
As second this is pure C app, so no java vm is needed, even if there
is pure tcp socket implementation in java arround (not to my knowlege)
it can’t be and it isn’t faster than this.

Profile
 
 
Posted: 23 May 2008 10:48 AM   [ Ignore ]   [ # 3 ]
Rank
Joined  2007-03-04
Total Posts:  65
New Member

tuio *related* sorry.... seems like when you have something that is sending tuio to localhost:3333, as well as something reading localhost:3333 udp, they block each other? wondering if anyone else has run into that

Profile
 
 
Posted: 23 May 2008 11:12 AM   [ Ignore ]   [ # 4 ]
Rank
Joined  2007-10-23
Total Posts:  87
New Member

I’m having a few strange problems. I run the proxy to forward the messages to tcp port 3000. If I try to connect to the tcp socket in flash I get an IOError, yet if I start the proxy debugger I can see the messages there, but when I try to connect again with flash, the socket connects but no data is recieved. Hmm…

Profile
 
 
Posted: 23 May 2008 11:33 AM   [ Ignore ]   [ # 5 ]
Avatar
RankRank
Joined  2008-03-02
Total Posts:  107
Member

th0m: how would be that .. If you can’t read of 3333 udp how would flosc run then ???
This app is doing just the same .. it sits and reads of udp 3333 and then it sends to another port.. is that simple smile

Weyforth: hmm to tell you the trouth I didn’t test it yet with flash, as I’m running on linux, and I have another
projects there.. So until I get some time (and will) I’ll try to do some example flash app.
One thing that cross my mind is that you first start the recieving part (flash app) then the proxy. (in case you did other way)
Post the results here as I’m interested to make it work.

Ps. I’m not even sure how the binnary socket works with flash .. this isn’t a server implementation, in another words
the app just sends tcp packets to specified port, If flash can capture them then it should work (I didn’t implemented any
server, or select code .. so if there is nothing listening on the port .. the messages are lost)

Profile
 
 
Posted: 23 May 2008 12:32 PM   [ Ignore ]   [ # 6 ]
Rank
Joined  2007-10-23
Total Posts:  87
New Member

Yes I think some sort of tcp server is needed. Have you any plans to implement one? Or is there one already available somewhere?

Profile
 
 
Posted: 23 May 2008 01:11 PM   [ Ignore ]   [ # 7 ]
Avatar
RankRank
Joined  2008-03-02
Total Posts:  107
Member

Hmm, I could implement a server, but I must first see how the flash is using tcip, so I don’t write code that has no use.
I’ll try to write something probably this evening, If I find some cool library that could speed up the process it would be over in a hour,
so stay tuned wink

Profile
 
 
Posted: 23 May 2008 01:21 PM   [ Ignore ]   [ # 8 ]
Rank
Joined  2007-03-04
Total Posts:  65
New Member

ya know, what i was talking about may be my own fault… two things 1) i was using a realtime patched kernel, and it may have i/o timing issues? i’m not sure and 2) i was using the python OSC library, which may be doing something funky i haven’t dug into it.... but the behavior was more an instantaneous one with the timer on which the python library read from the port… So, from the TUIO simulator, i would draw a line, and the library would skip about every 30th message saying that it couldn’t open the port for reading. So, not sure! I did notice when I used TUIO on another machine and sent the messages over the wire, i got far superior resolution on the messages. The server side was ubuntu (rt, right?) and was using the newer open jvm, so it might be that, that TUIO/java on linux is funky, I’m going to go play with this some, maybe see how demos/osc behaves…

Profile
 
 
Posted: 23 May 2008 01:34 PM   [ Ignore ]   [ # 9 ]
Avatar
RankRank
Joined  2008-03-02
Total Posts:  107
Member

hmm If you are in python world, you could try pyliblo, as this code is liblo based. (I didn’t still have time to check if pyliblo supports tuio over tcip but I think it shoud)

Profile
 
 
Posted: 23 May 2008 01:43 PM   [ Ignore ]   [ # 10 ]
Rank
Joined  2007-03-04
Total Posts:  65
New Member

hey that works perfect, thank you!

Profile
 
 
Posted: 25 May 2008 03:42 AM   [ Ignore ]   [ # 11 ]
Avatar
RankRank
Joined  2008-03-02
Total Posts:  107
Member

Ok I have added simple tcp server into the code, download of precompiled binaries (and the code) are on google code.
File is called tuio_tcp_sproxy.zip (server proxy) smile

Profile
 
 
Posted: 25 May 2008 06:47 AM   [ Ignore ]   [ # 12 ]
Rank
Joined  2007-10-23
Total Posts:  87
New Member

That’s great. I’ve tested the application but I am getting a “bind error”. Are there any parameters I need to pass to the program? Despite this I was still able to get it transferring data to flash successfully, I’m just concerned about that error.

Great work I’ll work on reading the data now. I’ll keep you updated

Profile
 
 
Posted: 25 May 2008 07:00 AM   [ Ignore ]   [ # 13 ]
Avatar
RankRank
Joined  2008-03-02
Total Posts:  107
Member

hmm bind error is when you restart the proxy soon after closing it ?.. As I had to implement nonblocking server to have it read the input, process and forward the message. It doesn’t close the socket on exiting
(or it does as I’m not sure how that works with nonblocking sockets) anyway the system closes it after few minutes. It’s rather strange as I added the SO_REUSEADDR flag to have it open the same socket without errors.
(maybe you have this error on start, as it doesn’t find the socket and reports that).
It’s really difficult to take in consideration all the possibilities as I’m writing cross platform code, and on linux and wine works without issues. Didn’t get the time to try it on Win dough.
P.s.
The server accepts -p portnum -t portnum in that order, otherway it exits. *if you start it without parrametars it’s using the default udp 3333 to tcp 3000
same goes with the dump app.

Profile
 
 
Posted: 25 May 2008 09:54 AM   [ Ignore ]   [ # 14 ]
Avatar
RankRank
Joined  2008-03-02
Total Posts:  107
Member

Ok I have added check prior to try the bind, here is attached ziped exe. It should fix that error.
keep me posted how it’s working. smile

Profile
 
 
Posted: 25 May 2008 12:39 PM   [ Ignore ]   [ # 15 ]
Rank
Joined  2007-10-23
Total Posts:  87
New Member

Heres a flash app to test with. It’s basically just dumping the information. At the moment all I’m getting is a connection, one data transfer, then the connection is lost.

File Attachments
tcp-test.zip  (File Size: 1729KB - Downloads: 724)
Profile
 
 
   
1 of 9
1
 
‹‹ MIDI      OSC LIST OF MESSAGES ? ››