I have an application for video streaming over UDP and it works completely success. I changed the socket to TCP. When it is running after a few packets transferring, receiver sends RST and it stops working. (The packet with a large length is also strange which transferred from sender to receiver while MTU is 1400 - what is this packet?)
I checked receiver and sender log. The last packet that was received by receiver has a large and strange sequence number (dump packet). It makes an error and then application stops. Sender is not sending such a packet. Where is this packet come from? Is it transport layer that makes it?
When I added a sleep time (0.1 second) to the sender after each packet sending. The program works without any strange large length packets in Wireshark or strange sequence number But this is not a reasonable solution for video. What is your suggestion now? what could be the problem? How could analyze this network? How could solve it?
TCP_NODELAY
option (seetcp(7)
man page). – Gil Hamilton