Is select() Ok to implement single socket read/write timeout ?

Posted by chmike on Stack Overflow See other posts from Stack Overflow or by chmike
Published on 2010-03-15T08:40:52Z Indexed on 2010/03/15 9:09 UTC
Read the original article Hit count: 218

Filed under:
|
|
|

I have an application processing network communication with blocking calls. Each thread manages a single connection. I've added a timeout on the read and write operation by using select prior to read or write on the socket.

Select is known to be inefficient when dealing with large number of sockets. But is it ok, in term of performance to use it with a single socket or are there more efficient methods to add timeout support on single sockets calls ? The benefit of select is to be portable.

© Stack Overflow or respective owner

Related posts about sockets

Related posts about c