Strange TCP delay when receiving data


My game is receiving data via TCP. Each "command" is separated by a new line. I use ReadLine to read the lines via a StreamReader and it works as it should. However, when the server sends two packets very fast, the first packet arrives, but the second one does not. Actually, it does arrive (checked with tcpdump) but socket.Available always returns 0, which avoids processing in unity. Only after some time when the server sends another independent command, the unity client processes the old packet and the new packet instantly.

I hope I could explain this. Anyone having a solution for this strange issue?

Seens the ReadLine function is just buggy. I wrote my own function and it works now.