ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Right now i am doing a server client program to stream video. The 2 computers are connected by a cable. I am using UDP to do the streaming, i facing quite some problems. Since there is no external traffic , the file i stream over should be idenitical with the file in the server. But this dont happen, there are alway mismatch between the sizes.
This only happen when i stream file which are more than 600kb. Under 600kb, the size of the file at the client side will match. I check it with the ethereal, the server will send an arp packet to find out the client ip address. Could anyone help me solve this problem , i been stuck at this for like 2 months
udp might be the problem. It's fast, but has near to 0 error recovery options (unlike tcp). Mostly used for services where packetloss isn't that important.
From the RFC:
This protocol provides a procedure for application programs to send
messages to other programs with a minimum of protocol mechanism. The
protocol is transaction oriented, and delivery and duplicate protection
are not guaranteed.
yes u are almost guaranteed packet loss with UDP. since ur on a lan the packets are probably getting to the reader much faster than they can keep up with and packets are being dropped. increasing the read buffer size will help a bit, but you will still see packet loss.(stevens unpv1)
You're using UDP...you'll just have to accept that there is some packet loss. But applications such as streaming sound, where a lot of data must be sent quickly (so minimal overhead is important, which UDP provides) and it's not important that all of it get there (when you're listening you're not going to notice a missing packet here or there) is exactly what UDP is designed for.
So I wouldn't worry too much, really. If you want everything to get there, use TCP--but be prepared for slower transfer times because of the additional overhead.