Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13321 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28303 invoked by uid 1010); 13 Oct 2004 14:07:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 28223 invoked from network); 13 Oct 2004 14:07:08 -0000 Received: from unknown (HELO iko.gotobg.net) (80.168.8.116) by pb1.pair.com with SMTP; 13 Oct 2004 14:07:08 -0000 Received: from p50835dc4.dip.t-dialin.net ([80.131.93.196] helo=[192.168.0.36]) by iko.gotobg.net with esmtpa (Exim 4.43) id 1CHjmW-0005Ul-QG; Wed, 13 Oct 2004 17:07:09 +0300 Message-ID: <416D360D.4050302@hristov.com> Date: Wed, 13 Oct 2004 16:05:01 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a4) Gecko/20040918 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Vincent NEGRIER CC: Wez Furlong , internals@lists.php.net References: <416C7873.9070602@t0x.net> <20041013014320.47616.qmail@pb1.pair.com> <00b101c4b10a$66cd0cc0$3702a8c0@stouen.esds.com> <019701c4b12c$c356a790$3702a8c0@stouen.esds.com> In-Reply-To: <019701c4b12c$c356a790$3702a8c0@stouen.esds.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iko.gotobg.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - hristov.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] Re: [PATCH] new function stream_socket_create_pair From: php@hristov.com (Andrey Hristov) Hi, at least my experience is that when a parameter's value is bad, FALSE is returned. In this case the code throws E_WARNING but continues exectuion assuming something. IMO it is better not to assume but to return FALSE. Thanks, Andrey Vincent NEGRIER wrote: > Here is an updated version of the patch : > http://si.kz/~six/stream_socket_pair.diff > > It now registers STREAM_AF_* and STREAM_SOCK_* long constants, checks the > domain and type against known types and passes the array of created streams > as return value instead of a byref param... and the diff is against today's > CVS this time :) > > regards, > Vincent > > ----- Original Message ----- > From: "Vincent Negrier" > Newsgroups: php.internals > To: > Sent: Wednesday, October 13, 2004 11:52 AM > Subject: Re: [PATCH] new function stream_socket_create_pair > > > >>>>the patch is here : >> >>http://si.kz/~six/stream_socket_create_pair_patch.tgz >> >>>To add to Wez's comments, I'd rather see it return an array of socket >>>streams (or FALSE on failure), rather than return true and tuck the >> >>streams >> >>>into a by-ref parameter. >> >>It would look simpler, but on the other hand it would break consistency > > with > >>the behavior of socket_create_pair() and the sockpair() syscall ... >> >>If the above is not a problem for anyone i can rewrite it to return a >>streams array (or FALSE), without the byref param. >> >>regards, >>Vincent > >