Client TCP Issue

Hi all

I am using the following code to get a message from a TCP server, and I get an error message: Client got end-of-stream.

How do I get rid of it?

import processing.net.*;

int port = 6789;       
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(whatClientSaid);
    } 
  } 
}
Sign In or Register to comment.