Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27906 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91488 invoked by uid 1010); 8 Feb 2007 14:03:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 91473 invoked from network); 8 Feb 2007 14:03:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2007 14:03:56 -0000 Authentication-Results: pb1.pair.com header.from=maurice@iceblog.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=maurice@iceblog.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain iceblog.de from 217.160.111.22 cause and error) X-PHP-List-Original-Sender: maurice@iceblog.de X-Host-Fingerprint: 217.160.111.22 p15097164.pureserver.info Received: from [217.160.111.22] ([217.160.111.22:54149] helo=p15097164.pureserver.info) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/C3-00136-BCD2BC54 for ; Thu, 08 Feb 2007 09:03:56 -0500 Received: (qmail 27194 invoked by uid 89); 8 Feb 2007 14:03:50 -0000 Received: from i3ed6c0fe.versanet.de (HELO ?192.168.178.20?) (moritz@mertinkat.net@62.214.192.254) by p15097164.pureserver.info with SMTP; 8 Feb 2007 14:03:50 -0000 Message-ID: <45CB2D6E.1020804@iceblog.de> Date: Thu, 08 Feb 2007 15:02:22 +0100 User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Moving Socket extension to PECL From: maurice@iceblog.de (Maurice) Hi there, unfortunately I haven't read your comments some months ago on moving the Socket extension to PECL. I just stumbled upon it yesterday while surfing around on Sara's blog (btw, great book!) and was quite upset about it... I've written a multiplexing connection suite in PHP5 (LGPL, but not yet released) that relies on the Socket extension. What it does? Well, multiplexing asynchronous TCP/UDP connections using socket_select. In my first tests I also included support for streams (using stream_select) in order to support SSL/TLS enabled connections. However, the SSL transport layer in the Stream "extension" is totally screwed up if you use asynchronous socket streams. I know that it is not the easiest thing to implement asynchronous SSL, but the main problem with streams is that the easy-to-use interface is not really suitable for complex things like async. SSL (for those involed: SSL_read may as also write to the connection and SSL_write may also read from it. This logic might be implemented in stream_select, but therefore the stream read/write functions must be a little bit more specific about what happend (SSL_get_error)). That's why I started extending the socket extension with socket_ssl_* functions that use the openssl extension (and thus are only available if PHP is compiled with openssl support). I will provide a patch for that once it's complete and out of beta status. In my opinion one should rather move the stream_socket functionality to the Socket extension (and maybe add a function like stream_create_from_socket()) then moving the Socket extension to PECL. Anyway, the Stream-SSL part has to be fixed _before_ moving the socket extension to PECL. Maurice.