Re: cvs socket extension

From: Date: Mon, 23 Jul 2001 16:10:34 +0000
Subject: Re: cvs socket extension
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-60782@lists.php.net to get a copy of this message
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" <chrisv@b0rked.dhs.org> To: "Markus Fischer" <mfischer@guru.josefine.at> Cc: "Daniel Beulshausen" <daniel@php4win.de>; <php-dev@lists.php.net> 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: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.dev (#60782) next »