Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
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.
I have just installed Fedora Core 2 on my notebook (HP NC6000) and have written a little software in C (GNU / GCC) to communicate with a network device. A TCP/IP device that decodes DVD data.
I noticed that the streaming of my data is not smooth and when I checked the ifconfig eth0, I found that there has been massive amount of collisions.
I am very new to GCC C development and have close to nothing about Linux. My question is
1) How do I go about determining collisions of packet during a send() or write() command.
2) How do I go about checking if my send() buffer has been read by the other end?
** It worked fine when I was using the same code in CYGWIN Windows version.
My questions may should somewhat silly to many, but I do hope the "gurus" out there would excuse a newbie.
1. You can't do anything just changing your code. Collisions happen on a lower level than your code. When there are collisions it doesn't mean your data does not arrive to the other end (it may take it more time, through). Making the whole thing very simple collisions happen when there's too much traffic in the network. If such situation happen, there's an automatic retransmission.
2. I'm not 100% sure (should look into the code), but if you're in blocking mode, you have the result as return code.
BTW When it's about media, maybe UDP is a better idea for you than TCP?
I am using TCP mode as my connection mode. I have not set blocking mode as I did not know the usage and functionality of blocking. What it does and it's reason of usage. In fact, the only error trapping I did was to determine if my send() function was working.
if (send(phSocket, szBuffer, 1460,0) <=0) printf("ERROR %d\n", errno);
Is there any site or reference where I can read about blocking mode and how I go about doing it?
Thank you again for the reply and much needed help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.