Language \ Environment \ Comparison
 
Index
 
  The Processing 1.0 _ALPHA_ Reference is a work in progress.
If you see any errors or have any comments, please write to: reas at groupc.net
Name  

netWrite()

   
Examples  
int port = 5204; 
int bgColor = 0; 
 
void setup() 
{ 
  // Starts a server 
  beginNet(port); 	 
} 
 
void loop() 
{ 
  // Writes data to the clients connected 
  netWrite(Integer.toString(bgColor)); 
 
  // Update the value 
  bgColor = bgColor + 1; 
  if (bgColor > 255) { 
    bgColor = 0; 
  } 
} 

Description   The netWrite() function writes data to all the connected clients if it is called in a server application and writes data to the server if it is called within a client application. It is only possible to send Strings with netWrite().
   
Syntax  
netWrite(data)
   
Parameters  
data   String: the data to be written to the server or client

   
Returns   None
   
Usage   Application
   
Related   beginNet()
endNet()
netEvent()
net
   
© 2003- 2001 Massachusetts Institute of Technology and Interaction Design Institute Ivrea
Processing is an open project initiated by Ben Fry and Casey Reas