It only happens in Androids, not PCs and my server is made using C++
Lets say I made a function for sending packet consists of 3 int and one char
void SendTestPacket(int num1, int num2, int num3) {
System.out.println("Function called");
if(true) {
clientOut.writeInt(1); // clientOut is a DataOutputStream
clientOut.writeInt(2);
clientOut.writeInt(3);
clientOut.writeChar('\n');
System.out.println("Data sent");
}
System.out.println("Function fully executed");
}
I tried using my android client to send one packet on every finger pan function called which has been called more than 1000~2000 times in 5 secs when dragging finger around the screen.
Somehow, during the process of dragging my finger, the function stop executing properly especially starting from the first clientOut.writeInt(int); until the end of if section. It's like 'break'or 'continue' statement has been called.
In the early part, I always got these kind of output
Function called
Data sent
Function fully executed
After a few moment, it became these kind of output every loop
Function called
Function fully executed
If I tested it on pc java client, it will never occurs no matter how I do it Sorry I forgot to mention it, its on Wirelesss Lan connection.
Edit
Actual Function Code
void SendTestPacket(int packettype, int num1, int num2) {
System.out.println("Function called");
try {
clientOut.writeInt(packettype); // clientOut is a DataOutputStream
clientOut.writeInt(num1);
clientOut.writeInt(num2);
clientOut.writeChar('\n');
System.out.println("Data sent");
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("Function fully executed");
}