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 › Network – setting "Client" timeout duration
Page Index Toggle Pages: 1
Network – setting "Client" timeout duration? (Read 822 times)
Network – setting "Client" timeout duration?
Jan 19th, 2010, 7:38am
 
Is there a way to set the default timeout of "Client" when attempting a connection to an IP?
Re: Network – setting "Client" timeout duration?
Reply #1 - Jan 19th, 2010, 12:52pm
 
Nevermind, a co-worker helped me solve it. His sketch uses a bit of Java to ping the server & make sure it's there.

Code:

void setup(){
 import java.net.InetAddress;
 String host = "192.168.1.12";
 int timeOut = 3000; // milliseconds
 boolean pingStat;
 try {
   pingStat = InetAddress.getByName(host).isReachable(timeOut);
   println(pingStat);
 }
 catch(Exception E){
 }
}

Page Index Toggle Pages: 1