mirror of
https://github.com/predis/predis.git
synced 2026-08-27 18:51:07 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user