[PLUG] function to tell if a socket has something ready to read?

Galen Seitz galens at seitzassoc.com
Thu Aug 5 17:05:02 UTC 2004


Russell Senior <seniorr at aracnet.com> wrote:

> 
> I am looking for a way (in C) to check (without waiting) for readable
> data on a socket without actually reading it (in part to allow all the
> reading to take place in one spot).  Any pointers?
> 
> Hmm.  I guess select() with a zero timeout would work.
> 

poll(2), select(2), select_tut(2), epoll(2)

I think epoll was added in 2.6.x.

Here's a paper from OLS comparing epoll, select, and poll.  I haven't
read it, so I don't know how useful it will be.
http://www.finux.org/Reprints/Reprint-Gammo-OLS2004.pdf


galen




More information about the PLUG mailing list