Re: cvs socket extension
| From: | Markus Fischer | Date: | Mon, 23 Jul 2001 14:27:48 +0000 |
| Subject: | Re: cvs socket extension | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-60760@lists.php.net to get a copy of this message | ||
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;
> };
>
> 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.
+1
But, someone with good knowledge of socket should comment if it
ever makes sense not to specify highest+1 so we can really drop
the first parameter.
- Markus