Fix read/write timeouts with PhpiredisStreamConnection.

This is a regression of commit 4db0017, using stream_socket_recvfrom()
bypasses stream wrappers thus read/write timeouts handled by PHP. The
only way to make them work again is to fetch the raw socket from the
stream resource and use socket_import_stream() which is unfortunately
a PHP 5.4+ function.
This commit is contained in:
Daniele Alessandri
2014-07-23 12:18:41 +02:00
parent 6fe56985fc
commit 9a05d43737
2 changed files with 51 additions and 2 deletions
+2 -2
View File
@@ -64,7 +64,7 @@ class StreamConnection extends AbstractConnection
* @param ParametersInterface $parameters Initialization parameters for the connection.
* @return resource
*/
private function tcpStreamInitializer(ParametersInterface $parameters)
protected function tcpStreamInitializer(ParametersInterface $parameters)
{
$uri = "tcp://{$parameters->host}:{$parameters->port}";
$flags = STREAM_CLIENT_CONNECT;
@@ -106,7 +106,7 @@ class StreamConnection extends AbstractConnection
* @param ParametersInterface $parameters Initialization parameters for the connection.
* @return resource
*/
private function unixStreamInitializer(ParametersInterface $parameters)
protected function unixStreamInitializer(ParametersInterface $parameters)
{
$uri = "unix://{$parameters->path}";
$flags = STREAM_CLIENT_CONNECT;