Hi,
I have a Server/Client architecture. When the client send two message back to back to the server, it gets read at the same time.
below is my code which is reading from the inputStream
view plaincopy to clipboardprint?
String str = "";
while (in.available() > 0) {
byte [] b = new byte[in.available()];
in.read(b);
str = str + new String(b);
System.out.println(str);
}
So now when the client sends "Hi" and "Hello" as two different messages, both messages are read at the same point.
Any way I can separate two message?
Thanks,
Saumil