Re: Sockets Extension Rework (API, etc...) VERY LONG
| From: | J Smith | Date: | Fri, 22 Feb 2002 00:09:39 +0000 |
| Subject: | Re: Sockets Extension Rework (API, etc...) VERY LONG | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-80283@lists.php.net to get a copy of this message | ||
I'm all for fixing this extension up to make it better, but I'm a little
concerned with totally dropping the fd_* functions. How would you mimic
their use in something like a multiplexing using a blocking call situation
after the change? I have no idea how it can be done without using the fd_*
function. (But then again, I'm used to using the FD_* macros in C, so maybe
there's better way in PHP.)
Just wondering, because I acutally use this extension in a multiplexing
kind of way with indefinite socket_select blocking and multiple clients and
all that jazz already. Yeah, I know it's experimental and stuff, but it has
yet to fail, even with my "daemon" script running for weeks on end under a
fair load. I use the socket functions in a search engine that's constantly
listening for connections using socket_select, and the socket_fd* functions
are used quite a bit, hence my concern. (Not that I'm adverse to the
change, 'cause I'm sure I'll cope, but I'd like to know if it will be
possible to port my existing stuff over to the new API.)
J
Jason Greene wrote:
>
> 2. Get rid of socket_fd_*.
> -----------------------------
>
> It makes little sense to make fd masks available to the user, because
> this can be much easier to handle by using arrays.
>
> This will fix the max_fd code that attempts to calculate the highest
> file descriptor in the fd_set.
>
> Select would then look like
> socket_select (array read_socks(), array write_socks(), array
> except_socks(), int tv_sec, int uv_sec)
>