Here is my code
for ( i = 0 ; i < 2 ; i ++ ){
socket.writeUTFBytes("Command"+i);
socket.flush();
}
The Question is why I add socket.flush()
, others still received Command0Command1
instead of Command0
and Command1
. I guest there must have some delay between first flush and second flush, so now the only thing I can do is make a timer to solve this problem. Is there other solution?