Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13306 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39942 invoked by uid 1010); 13 Oct 2004 00:49:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 39915 invoked from network); 13 Oct 2004 00:49:21 -0000 Received: from unknown (HELO mproxy.gmail.com) (216.239.56.250) by pb1.pair.com with SMTP; 13 Oct 2004 00:49:21 -0000 Received: by mproxy.gmail.com with SMTP id w67so91535cwb for ; Tue, 12 Oct 2004 17:49:17 -0700 (PDT) Received: by 10.11.117.39 with SMTP id p39mr570600cwc; Tue, 12 Oct 2004 17:49:17 -0700 (PDT) Received: by 10.11.117.13 with HTTP; Tue, 12 Oct 2004 17:49:17 -0700 (PDT) Message-ID: <4e89b4260410121749508338ea@mail.gmail.com> Date: Wed, 13 Oct 2004 01:49:17 +0100 Reply-To: Wez Furlong To: six Cc: internals@lists.php.net In-Reply-To: <416C7873.9070602@t0x.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <416C7873.9070602@t0x.net> Subject: Re: [PHP-DEV] [PATCH] new function stream_socket_create_pair From: kingwez@gmail.com (Wez Furlong) 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 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 > >