By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,194 Members | 811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,194 IT Pros & Developers. It's quick & easy.

Example of C++ wrapper for select() ?

P: n/a
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.
Jun 21 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.