The essence of the patch is ok, it's just the checking of the type and
domain args that is too magical.

Probably the best thing to do is register integer constants for
AF_INET etc., but name them STREAM_AF_INET, STREAM_AF_INET6,
STREAM_AF_UNIX, STREAM_SOCK_STREAM and STREAM_SOCK_DGRAM.  Look for
REGISTER_LONG_CONSTANT in file.c to find where and how to register
those constants.

I'd also prefer to name the function stream_socket_pair().

If you can make those changes and then post a link to a unified diff
against CVS (see README.SUBMITTING_PATCH in the PHP source for more
hints), it can go in to PHP.

Thanks :)

--Wez.


On Wed, 13 Oct 2004 02:36:03 +0200, six <[EMAIL PROTECTED]> wrote:
> hi,
> 
> this patch against php-5.0.2 adds a stream_socket_create_pair()
> function. it's nearly identical to socket_create_pair() except it
> returns streams instead of socket resources.
> 
> i'm currently rewriting a sockets daemon framework using streams with
> the added benefit of ssl and other stream goodies, but when it comes to
> IPC i have to use both stream_select() and socket_select(), which is
> quite disturbing and also requires the sockets extensions for something
> that's not really sockets anyway ...
> 
> the patch is here : http://si.kz/~six/stream_socket_create_pair_patch.tgz
> 
> i think this one, or at least some way in userspace to cast a socket
> resource to a stream one would be great.
> 
> regards,
> Vincent
> 
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to