We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Send data between 2 pc's running processing
Page Index Toggle Pages: 1
Send data between 2 pc's running processing (Read 2029 times)
Send data between 2 pc's running processing
Jun 18th, 2009, 3:20pm
 
Hi!

I'm not sure if it's possible to communicate 2 processing sketches running on 2 different computers via OSC.

If that's possible, what's the right way to communicate both pc's? An ethernet wire, wifi connection? Should I use a normal OSC connection with oscP5 (the same case like 2 sketches running on a pc) or I need to use TCP protocol?

Thanks in advance!
Re: Send data between 2 pc's running processing
Reply #1 - Jun 18th, 2009, 9:32pm
 
you can do it both ways. when it comes to networking computers in a loca network, i prefer a connectionless network protocol like UDP instead of the connection-oriented TCP protocol.

UDP or TCP protocol? the difference is that with UDP you just send out messages to an ip address and port number, the protocol does not care if the message reaches its destination, the protocol does not know about the existence of the destination. tcp on the other side makes sure each message that was sent gets to its dedicated location in the exact order it was sent. TCP does take better care of data sent across a network but is also more particular when it comes to setting up network connections (server has to run first before clients can connect. TCP is good for sending big chunks of data e.g. images, video, files.) processing comes with a tcp server/client example that you could try (SharedCanvasClient,SharedCanvasServer).

UDP is pretty straight forward - you start listening for messages and you sent messages. OSC itself is not a network protocol, but can operate on top of a network protocol. for oscP5, UDP is the default network protocol. to make 2 different computers communicate with each other, you need to know each computer's ip address which, in case of oscP5, are used as the remote netAddress. the oscP5sendReceive example might be a good starting point.

connection-wise you can use a local area network, e.g. connecting computers with a router (your ip address would probably start with 192.168.x.x or 10.x.x.x ). or, if you only have 2 computers you can connect them with an ethernet cable and assign a manual ip address for each machine (same goes for wifi connection, on mac you can try 'create network...' in your network settings to setup a small local network).
if i would make a recommendation, that would be OSC.

best,
andreas
Re: Send data between 2 pc's running processing
Reply #2 - Jun 20th, 2009, 10:58pm
 
Hi,

a couple of years ago (September 2007), I created some sort of 3D chat sketch that allowed people to talk to each other as long as you were on the network.

You can take a look at it if you want to know more about connecting more than 1 cpu. It was one of my first sketches but it still works fine. Maybe there's a better way of doing it now.

Everything is in French but you should manage to understand the code.

You can download the source here :

http://computerarts.ca/_files/processing/3DChat.zip

Hope it helps
Steven
Page Index Toggle Pages: 1