Recv() call with timer(time out )

Hi all,
I am facing a problem in recv() system call i.e.. in my project i have to implement timer for sending (data) and resending purpose when there is no acknowledgement.

is there any way that recv() sys call has its own timer i.e., for ex: recv() has to wait for 10 secs.

if any one knows plz help me.
waiting for ur reply.

byee.

There's two ways. One, you implement your own polling routine using recv() with the NOWAIT flag. This is not a POSIX-friendly solution. Two, use the select() call to wait for the file descriptor to be ready, then call recv(). The man page is guaranteed to be cryptic, so You should look for a tutorial on UNIX system program, especially with select().

to make a timeouted socket syscall e.g read,send,sendfile...

epool ==> linux
kqueue ==> ( kernel queue ) FreeBSD/dragonflyBSD..
/dev/poll ==> solaris
WaitForSingleObject ==> win$hit
pool/select ==> for other

checkout the Apache Portable run-time API (apr) for a full implementation