How to read all of Inputstream in Server Socket JAVA
The problem you have is related to TCP streaming nature. The fact that you sent 100 Bytes (for example) from the server doesn’t mean you will read 100 Bytes in the client the first time you read. Maybe the bytes sent from the server arrive in several TCP segments to the client. You need to … Read more