Software like humans have behaviour, and more we use one we come to know about its behaviour..A Socket and ServerSocket connection was abruptly throwing EOFException in a slower network of 2 mbps but the same works without a single problem on the 100 mbps network. Apparently, Java was not throwing the timeout exception.
This problem was not coming always. The data flow of byte array was flowing properly without any problem in most of the cases.. But all of sudden, some of the packets seemed to be dropped.. As the receiving program did not get the complete bytes it was not able to construct a complete object using deserialization.
This whole problem embedded inside full fledged application makes it difficult to locate. DataOutputStream.writeUTF and DataInputStream.readUTF seams to fail.
In this process some tools came quite handy. AutoIT was a good tool for simulating user interface test cases. Its very easy to write script for making mouse clicks, keypress and window activation. I am sure its going to be useful to me in many of future projects. Another tool was Speed Limiter. When we do load testing in 100 mbps network our application works differently then over slower network. This makes it important to do load testing over slower networks like 56 kbps(Dial up), 1mbps, 2 mbps(BroadBand) networks. The timeouts, buffer size, queue size should be tuned for these network connections. We can run Speed Limiter on the Server system, on the port on which server was going to run and run the server on different port. Then we can mention the port mapping in Speed Limiter. You can select different speeds at which you want to do simulation. Only feature i missed in this tool was jerks or spike. In real network the connection gets stuck for some seconds and then starts again. This cannot be simulated here.
Coming back to core problem, i thought that there might be some software component in network like Antivirus which may be dropping/blocking some packets. But it was not the case. The problem was with the connection timeout. It the connection timeout was set to 10000 and above using Socket.setsotimeout function the problem gets solved..
So all that appeared to be a serialization problem was actually a timeout problem.
There are other serialization problems which i am facing like a long value being serialized over network gets divided by 32 on the receiving end. Then in one more case a String if has length more than 128 bytes gives StreamFormatException when serialized. I will update about same once i resolve the issues..