Example of C++ wrapper for select() ?

P

Phil Endecott

Dear All,

I'm sure this is a problem that has been solved before. I'm looking for
a tidy, not-inefficient and fairly thin C++ wrapper for the select()
system call. Ideally it would look something like this:

FileDescriptor f1;
FileDescriptor f2;
FileDescriptor& readable_fd = Select(f1.readable || f2.readable);

Does anyone have any pointers, or suggestions?
The main issues as far as I can see are:
- what does it return?
- what does it return on timeout?
- how do you pass a variable number of file descriptors?
- can you build the fdsets in one pass?

Thanks,

Phil.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,589
Members
45,100
Latest member
MelodeeFaj
Top