Client got out-of-Stream. Network library

edited April 2014 in Library Questions

Hello everybody, I am working on a project in wich I want to send and recieve data (Strings) from a device wich is connectet via ethernet. The reason for ethernet is because these devices are used in industrial enviroment and are organized in a network. The device has a chip on it which creates its own webserver.

I have no access to the firmware of the device. All I've got ist the data for connecting (IP, Port, etc) and the information for the communication protocol (the fabricator made its own protocol).


    if I send the String: GET VER\n
    the Device sends me: S V1.13 @ LED-C3A Controller\n
    (every message has a line-feed ('\n') at the end in both directions.)

Also I know it connects via TCP.

The device connects correctly. I've tested it with the Software with which it is delivered.

The problem:

500-600ms after I've started my program I get the message: client got out-of-Stream. After that I cant send any commands without getting more errors.

The odd thing is that I send a command, after the connection is set, then wait 600ms (required from protocol), lose the connection (client got out-of-Stream) and get the correct answer from the device.

Here is my code:

Client SLUX;

String dataIn = new String("");

void init_SLUX()
  println("connect to:");
  SLUX = new Client(this, "", 1580);

  println("command: get version");
     SLUX.write("GET VER" + '\n');
     int millisStart = millis();
     while ((millis() - millisStart) < 600){;} ;
  println("check answer");
       if (SLUX.available() > 0) 
      dataIn = SLUX.readString();
      print("version is: ");

    println("end of init");

    void setup()
      size(displayWidth - 50, displayHeight - 100);


    void draw()


I used println() insted of Breakpoints since there is no such thing in Processing (yet). Here is the terminal-output I get when I run the program:

connect to:
command: get version
Client got end-of-stream.
check answer
version is: S V1.13 @ LED-C3A Controller 1

end of init

Any suggestions?

PS: Please excuse my english. It's not my native language.


  • Answer ✓

    Problem solved. Please close this Discussion.

Sign In or Register to comment.