Moving Socket extension to PECL

From: Date: Thu, 08 Feb 2007 14:02:22 +0000
Subject: Moving Socket extension to PECL
Groups: php.internals 
Request: Send a blank email to internals+get-27906@lists.php.net to get a copy of this message
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.

« previous php.internals (#27906) next »