> On Mon, Jul 23, 2001 at 07:20:34AM -0700, Chris Vandomelen wrote :
> > > > >
> > > > >socket_select(0x7fffffff, $fd_set, 0, 0, 0, 0);
> > > >
> > > > we can add a support function which return's the php_socket->socket integer.
> > >
> > > Glad someone came up with this.
> > >
> > > Since socket_select() always wants highest +1, couldn't this be
> > > implemented into socket_select() to go through all socket sets
> > > and get the number itself ?
> > >
> > > Or are there good reasons to let the user specify the value on
> > > its own ?
> > >
> >
> > In theory, the user isn't going to be specifying sockets that aren't
> > accessible as resources.
> >
> > The best way around this (IMHO) is to define a php_fd_set something like:
> >
> > struct php_fd_set {
> >     fd_set the_set;
> >     int    max_fd;
> > };
>
> Btw, is this really enough information ?
>
> Consider this:
> You use FD_SET() to add a socket to the set (you just bump_up
> max_fd if socket > max_Fd)
>
> But when using FD_CLR() to remove a socket how do we know
> which socket in this set has the highest number now
> and whats the number anyway (beside 42) then ?

If one is removed, it doesn't hurt the end result. If one is added outside
of max_fd and max_fd isn't raised appropriately, you run into trouble.

Chris


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to