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.
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.