views:

42

answers:

1

hi guys !
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

A: 

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.

caf
Thanks for replyI don't know much about networking, becoz m new in n/w programming.By review my log files.I found that before send data, data length is 16384 bytes and at recieving end stream length is 11300 and next stream of 5084 bytes.But sometime it recieve full length data of 16384 bytes.this may be happened because pwnat is working on udp over tcp and it is based on the concept of udp tunneling .
SR Dusad
@SR Dusad: TCP **does not** have an concept of individual messages within a stream. If you send 16384 bytes, you will eventually receieve those 16384 bytes - but you might recieve them in any number of chunks, of any size. Your application has to handle that.
caf
Thanks caf : your answer help me a lot for understanding the concept
SR Dusad