Thanks for the quick response!
Exactly that was what I thought. I've used system select() before
and I knew what I needed for the first parameter but heck I got
no idea from which var/fucntion to retrieve this value.
thanks !
- Markus
On Mon, Jul 23, 2001 at 05:14:29AM -0700, Chris Vandomelen wrote :
> > Morning ...
> >
> > Has anyone a working example on using the new socket_select()
> > call with non-blocking connection-oriented sockets? blocking
> > sockets with socket_accept() work like a charm. But I can't get
> > socket_select() to work.
>
> That's because of the patches that were made. Try specifying 0x7FFFFFFF or
> something equally large for max_fd (the first argument to select) and it
> *should* work.
>
> The reason it doesn't work is because file descriptors were changed from
> ints to resources, and since the first argument to select() (and therefore
> socket_select()) must be greater than the largest file descriptor in the
> set, and resource number != file descriptor.. should be obvious. :)
>
> Try something like:
>
> --------------------------
> $someport = 3334;
>
> $fd = socket_create_listen($someport, 5);
>
> $fd_set = socket_fd_alloc();
> socket_fd_set($fd, $fd_set);
>
> socket_select(0x7fffffff, $fd_set, 0, 0, 0, 0);
> --------------------------
>
> to force the select function to see all of the file descriptors in the set
> (as the socket_fd_* functions do the Right Thing when dealing with the
> resources).
>
> Chris
>
> >
> > ty
> > - Markus
> >
> > --
> > 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]
> >
> >
--
Markus Fischer, http://guru.josefine.at/~mfischer/
EMail: [EMAIL PROTECTED]
PGP Public Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0
--
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]