Guys. Hey. Faced such a problem, if you send packets from the engine to the server with a frequency of more than 20 times / sec, they begin to merge, in particular, the end of the old is added to the beginning of the new one. For example, two messages are sent that consider the same action: login lines and the same one. But the server sees as action:loginaction:login . This is the situation with TCP. Is there any way to solve this problem?
if (inputStream.available() > 0) { System.out.println("Have messege"); byte[] bytes = new byte[1024]; int length; length = inputStream.read(bytes); String result =new String(bytes, 0, length); System.out.println(result); } I think you understand that transferring data 10 times per second is not very.
BufferedReader.readLine(). - zRrrwritecall will be read by one call toread. It has never been like this. TCP - streaming thing. The boundaries between messages are your responsibility, not TCP protocol. If you want the protocol to follow the message boundaries for you, you need something high-level, like SOAP. - VladD