Just for curiosity, did you considered implementing poll instead of select? You would
not have to worry about specifying
max_fd - 1.
-Jason
----- Original Message -----
From: "Chris Vandomelen" <[EMAIL PROTECTED]>
To: "Markus Fischer" <[EMAIL PROTECTED]>
Cc: "Daniel Beulshausen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, July 23, 2001 9:20 AM
Subject: Re: [PHP-DEV] cvs socket extension
> > > >
> > > >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;
> };
>
> Then, whenver someone calls fd_set() or fd_zero(), change
> php_fd_set.max_fd appropriately as well as updating php_fd_set.the_set,
> and in socket_select(), check all of the max_fd values.
>
> Removing the first arg to socket_select(), if that's implemented, wouldn't
> be a bad idea either.
>
> 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]
>
--
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]