Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38914 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32174 invoked from network); 11 Jul 2008 20:03:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jul 2008 20:03:04 -0000 Authentication-Results: pb1.pair.com header.from=jochem@iamjochem.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jochem@iamjochem.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain iamjochem.com from 194.109.193.121 cause and error) X-PHP-List-Original-Sender: jochem@iamjochem.com X-Host-Fingerprint: 194.109.193.121 mx1.moulin.nl Linux 2.6 Received: from [194.109.193.121] ([194.109.193.121:57783] helo=mx1.moulin.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A3/42-18817-67CB7784 for ; Fri, 11 Jul 2008 16:03:03 -0400 Received: from localhost (localhost [127.0.0.1]) by mx1.moulin.nl (Postfix) with ESMTP id 95EF526D01A; Fri, 11 Jul 2008 22:02:59 +0200 (CEST) X-Virus-Scanned: amavisd-new at moulin.nl Received: from mx1.moulin.nl ([127.0.0.1]) by localhost (mx1.moulin.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id huGv80RjbiNZ; Fri, 11 Jul 2008 22:02:52 +0200 (CEST) Received: from [192.168.2.104] (dhcp-077-250-159-054.chello.nl [77.250.159.54]) by mx1.moulin.nl (Postfix) with ESMTP id E2C7E26CF85; Fri, 11 Jul 2008 22:02:51 +0200 (CEST) Message-ID: <4877BC6B.5070001@iamjochem.com> Date: Fri, 11 Jul 2008 22:02:51 +0200 User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Lukas Kahwe Smith CC: Richard Krehbiel , internals@lists.php.net References: <19b0b5c00807100543o50773d26hb7f429e348991191@mail.gmail.com> <657EF460-CBD3-4A03-8B93-7E98C46C8C9B@pooteeweet.org> In-Reply-To: <657EF460-CBD3-4A03-8B93-7E98C46C8C9B@pooteeweet.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] persistent sockets need help From: jochem@iamjochem.com (Jochem Maas) Lukas Kahwe Smith schreef: > > On 10.07.2008, at 14:43, Richard Krehbiel wrote: > >> Here's the big part: I was thinking that a semantic change to persistent >> sockets might make it easier for scripts to work "correctly" without >> bothering them too much. The change is this: If a script doesn't >> "fclose" >> it's "pfsockopen"ed socket, it gets closed *for real* when the script >> ends. >> >> I suggest this because I think it would make scripts "just work" in the >> presence of failures, even if the script coder doesn't completely >> understand >> the principle; it makes the transaction boundaries "automatic". The down >> side is that, if a script forgets the fclose, things work but it doesn't >> recycle sockets, it makes new ones all the time. >> >> The other down side is that for old scripts that never had an fclose in >> them, they stop getting recycled pfsockets until the fclose is added. >> >> I'm going to do *something* about this myself, anyway. I'd really >> like it >> if a solution were adopted into the main code base. > > > I think this might generally be a solution to make persistent > connections less error prone in PHP. This includes database extensions > as well. However it does strike me as something that should be done in a > major PHP version .. would it not be less intrusive to offer a pfclose() in a combination with something like use_pfclose()? where by any persistent handles opened after a call to use_pfclose() would require a pfclose() or other be truly closed as per Richard suggestion. In this way the "just works" principle is upheld, and there is no need to change anything in the current behaviour. A developer can actively choose to implement persistence state protection or whatever it might be called outside my kingdom :-) In addition this allows for a possible semantic change of fclose() to allow actually closing persistent connections? [sorry for the noise.] > > regards, > Lukas Kahwe Smith > mls@pooteeweet.org > > > >