Search code examples
c#tcpnetwork-programmingudppwnat

paket drop and splits in udp tunnel


Currently I am working on video conferencing project.For this i m using pwnat for nat traversing. pwnat is based on udp tunneling.I m using the TCP connection for data transmission.

My problem is that when i send a packet , it does not reach properly at its destination side . Sometime it drops the packet and many times it breaks ( split ) the packet into pieces.

Please Help me ..

How can i send and recieve a packet into single piece. So, i can draw image properly and play sound.

Any kind of help will be appriciated .

Thanks in advance


Solution

  • TCP has no concept of packets. A TCP stream is a continuous stream of bytes - if you want a structure within that stream of bytes, you have to impose it yourself, by implementing some kind of framing mechanism. A simple one is the "length prefix" - when sending an application-level frame, you first send the length of the frame, then the data.