- Processing
- p5.js
- Processing.py
- Processing for Android
- Processing for Pi

- Processing Foundation

This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

Class | Server
Name | ### available()
Examples |
    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 | Server: any variable of type Server
Returns | Client

Updated on January 1, 2021 03:38:10am EST
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.