Results 1 to 4 of 4
Hi...
I am trying to write the code for the single server and multiple clients. in server iam using the threads concepts to handle the requests of multiple clients.. but ...
- 06-05-2008 #1Just Joined!
- Join Date
- Nov 2007
- Posts
- 27
single server - multiple clients code in C, Socket Programming
Hi...
I am trying to write the code for the single server and multiple clients. in server iam using the threads concepts to handle the requests of multiple clients.. but i am unable to do that... can any one suggest the detailed approach hoe to handle threads in the server.....
thanks in advance...
regards,
Spymate..
- 06-05-2008 #2
Two pieces of advice.
- Don't use threads unless it's absolutely necessary. Use fork() and separate processes if possible. The reason is that threads share the same heap space, and a bug in one thread can first manifest itself with "misbehavior" in completely correct code in another thread, because that second thread's data has been corrupted. This situation can provide endless hours of debugging joy, jacking up frustration and the cost of maintaining your code and debugging it to an almost infinite degree.
- If you have not done so already, run (don't walk) to your nearest bookseller and order a copy of UNIX Network Programming, volume one, by W. Richard Stevens of happy memory, published by Addison Wesley. Then take a rainy weekend and curl up and read most of the book. A "detailed approach" to any aspect of network programming is far beyond the scope of a Linux help site.
Hope this helps.--
Bill
Old age and treachery will overcome youth and skill.
- 06-09-2008 #3Just Joined!
- Join Date
- Nov 2007
- Posts
- 27
thanks ....
how can we calculate crc for udp packet and i just wanted to test the server
that is responsing to each client request properly or not,,
Is there any way to do that .......
- 06-09-2008 #4There certainly is. There's an excellent section in chapter 29 of UNIX Network Programming, volume 1, entitled "Examining the UDP Checksum Field". This section is 22 pages long, and I'm obviously not going to type it in by hand. :)how can we calculate crc for udp packet and i just wanted to test the server
that is responsing to each client request properly or not,,
Is there any way to do that
I think that in the long run you will profit by having this book on your bookshelf.
Another alternative is to google this:
Code:"UDP checksum"
--
Bill
Old age and treachery will overcome youth and skill.


Reply With Quote