Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have written simple TCP server-client programs in 'C' on my RHEL 5 64 bit.
I want to add SEND and RECEIVE timeout for this socket; so that if server is not responding in given time, request will get timeout instead of waiting in "recv" call.
But I failed to do so. can anybody help around it OR can redirect me to some link that will explain this.
But this you tell about connect;
1) Is this applicable to "recv" and "send" system calls as well.
2) Is there any other way, other than signal handling; like we dose in case of normal sockets as follows,
yes that does make sense, I told you that alarm should work on send and recv functions.
There are three ways to place a timeout on an I/O operation involving a socket.
1. Call alarm, which generates the SIGALRM signal when the specified time has
expired. This involves signal handling, which can differ from one implementation
to the next, and it may interfere with other existing calls to alarm in the process.
2. Block waiting for I/O in select, which has a time limit built in, instead of blocking
in a call to read or write.
3. Use the newer SO_RCVTIMEO and SO_SNDTIME) socket options. The problem
with this approach is that not all implementations support these two socket options.
Each is appropriate, depending on the specific circumstances. I hope this helps.