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 & HelpOther Libraries › Connecting from a PC to a Laptop
Page Index Toggle Pages: 1
Connecting from a PC to a Laptop (Read 426 times)
Connecting from a PC to a Laptop
Jan 19th, 2009, 5:29pm
 
Does anyone know how to connect to a laptop using Processing over the internet?
Re: Connecting from a PC to a Laptop
Reply #1 - Jan 19th, 2009, 5:45pm
 
Sure, but you will need to have a specific IP address so that two computers (your desktop PC and your laptop) can find each other.  You can do this easily if you have been given a static address by your institution, or you can use a free service like DynDNS to allow others to locate your computer over the internet using an URL.

I believe this may be of help: http://processing.org/reference/libraries/net/index.html
Re: Connecting from a PC to a Laptop
Reply #2 - Jan 19th, 2009, 6:39pm
 
I tried using this code for my laptop

import processing.net.*;
Client myClient;
int dataIn;

void setup() {
 size(200, 200);
 // Connect to the local machine at port 5204.
 // This example will not run if you haven't
 // previously started a server on this port
 myClient = new Client(this, ip address, 5204);
}

void draw() {
 if (myClient.available() > 0) {
   dataIn = myClient.read();
 }
 background(dataIn);
}

and used my PC's ip address from here http://whatismyipaddress.com/, but it's not working. please, can anyone help me?
Re: Connecting from a PC to a Laptop
Reply #3 - Jan 19th, 2009, 7:04pm
 
A bit more information is required for your problem.

There's a syntax error here, or you've replaced "ip address" with what you got from that website you linked to:
Code:

myClient = new Client(this, ip address, 5204);  


You also need to know that depending on your local network setup, you may not access that address externally.

Also, what are you running on your server (your desktop PC)?

Perhaps you can run both the server and the client programs on the same computer first, then test it on separate computers later.
Page Index Toggle Pages: 1