Not receiving all message via TCP in Java?

Posted by javatcp on Stack Overflow See other posts from Stack Overflow or by javatcp
Published on 2010-03-31T18:12:57Z Indexed on 2010/03/31 18:23 UTC
Read the original article Hit count: 300

Filed under:
|

I have a tcp socket sending three lines like this

        out2.println("message1\n");
        out2.println("message2\n");
        out2.println("message3\n");

and another tco socket receiving and displaying these messages like this

        System.out.println(in.readLine());
        System.out.println(in.readLine());
        System.out.println(in.readLine());

but only the first message is recieved and displayed, anything I send after that is not.

© Stack Overflow or respective owner

Related posts about java

Related posts about tcp