curl-library
Re: working on a new API
Date: Mon, 29 Oct 2001 23:56:14 +0100 (MET)
On Mon, 29 Oct 2001, Ben Greear wrote:
> > Thinking about it, I'm not sure it is possible/portable to merge one fd_set
> > with another one. The functions FD_SET, FD_CLR and FD_ISSET all operate on
> > single FDs on the fd_set type. We might need to use plain FDs to make it work
> > everywhere.
>
> The method call I use for things like this looks like:
>
> /** Updates the file descriptors which need to be selected on
> * for this endpoint.
> */
> virtual void updateFdset(fd_set & input_set, fd_set & output_set,
> fd_set & exc_set, int& max_desc, uint64& now);
Right! This has the only minor drawback that you must call this function
first and then set your own FDs to the fd_sets, and you can't combine two
independent curl_select handles into one single select(). Not that I can
think of any possible situation when anyone would wanna do that! ;-)
> Later I will ask this class if it needs to read/write, and if so, I'll
> pass in the fd_sets and that class can check to see if any of the FD's
> it's interested in are set in the fd_sets.
>
> NOTES: There are exactly 3 fd_sets and one select loop in the entire
> program, they are just passed around by reference where needed.
Just curious, what's the 'now' for in this context?
-- Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/Received on 2001-10-29