FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Back  
   
  Reference for Processing (BETA) version 91+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.  
Class   Server
   
Name  

available()

   
Examples  
// Example by Tom Igoe 
 
import processing.net.*; 
 
int port = 10002;       
Server myServer;        
 
void setup() 
{ 
  size(400, 400); 
  background(0); 
  myServer = new Server(this, port); 
} 
 
void draw() 
{ 
  // Get the next available client 
  Client thisClient = myServer.available(); 
  // If the client is not null, and says something, display what it said 
  if (thisClient !=null) { 
    String whatClientSaid = thisClient.readString(); 
    if (whatClientSaid != null) { 
      println(thisClient.ip() + "\t" + whatClientSaid); 
    } 
  } 
} 
 

Description   Returns the next client in line with a new message.
   
Syntax  
server.available()
   
Parameters  
server   any variable of type Server

   
Returns   Client
   
Usage   Web & Application
   
 
 






   
 
Updated: Fri Jul 15 16:41:09 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info  
esource.org/cc/ShareAlike" /> -->     Processing is an open project initiated by Ben Fry and Casey Reas     © Info   nt> and Casey Reas     © Info   ource.org/cc/Notice" /> -->     Processing is an open project initiated by Ben Fry and Casey Reas     © Info   native file format.