Re: socket_select() problems?

From: Date: Tue, 04 Jun 2002 04:55:18 +0000
Subject: Re: socket_select() problems?
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-84836@lists.php.net to get a copy of this message
Just to clarify the "horrible" interface. Yes, it could have been written differently, though I did not want to drift to far from the C API semantics(which I believe are perfectly fine). I posted the API rewrite agenda(which made it into 4.2.0), several updates, examples,and answered questions quite awhile ago. True the documentation is lacking, though I have not had the time to work on it. I am planning on spending a lot of time before 4.3.0 because I would lake to change the status of this extension from EXPERIMENTAL to STABLE socket_select() behaves exactly as the select() system call with a few exceptions. 1. fd_sets are arrys: This means instead of FD_ISSET, use in_array() This also allows all the nice/powerful php features, such as using array_walk() 2. It returns FALSE on error instead of -1 3. It forces you to at least pass one array, because some OS's socket implementation (namely win32) does not allow select to be used as a wait call -Jason On Sun, 2002-06-02 at 09:33, Rasmus Lerdorf wrote: > Yeah, I guess so. It just isn't very clear how this is mapped to PHP in > the current docs. I will write up some better docs. > > -Rasmus > > On Sun, 2 Jun 2002 derick@php.net wrote: > > > On Sat, 1 Jun 2002, Rasmus Lerdorf wrote: > > > > > So you save the original array of sockets to pass back in. This is why > > > the C API has FD_ISSET() to check the result of a select(). I really > > > don't like this current behaviour of socket_select(). It will confuse the > > > hell out of anybody coming at this from a C background. > > > > I always thought the C select() function also mangles the sets: > > > > (from 'man select') > > > > On exit, the sets are modified in place to indicate which > > descriptors actually changed status. > > > > > > regards, > > Derick > > > > > On Sun, 2 Jun 2002, Philip Olson wrote: > > > > > > > I only get [0], never [1]. Did about 40 tries. > > > > > > > > latest CVS > > > > ./configure --enable-sockets > > > > > > > > If you need more info, let me know. > > > > > > > > Regards, > > > > Philip Olson > > > > > > > > > > > > > > > > > > > > > -- > > > PHP Development Mailing List > > > <http://www.php.net/> > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > --------------------------------------------------------------------------- > > Did I help you? > > http://www.jdimedia.nl/derick/link.php?url=giftlist > > Frequent ranting: http://www.jdimedia.nl/derick/ > > --------------------------------------------------------------------------- > > PHP: Scripting the Web - derick@php.net > > All your branches are belong to me! > > SRM: Script Running Machine - www.vl-srm.net > > --------------------------------------------------------------------------- > > > > > > -- > > PHP Development Mailing List <http://www.php.net/> > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.dev (#84836) next »