From 5d070481176c6ea4c300a675d6935b24460e42d7 Mon Sep 17 00:00:00 2001 From: gamadoleo Date: Tue, 1 Oct 2019 12:39:56 -0300 Subject: [PATCH] Update SocketTrait.php A suggestion/question would not be interesting to define a stream_set_timeout (), since the timeout set when opening the socket connection is for connection establishment only and not for read data? --- src/SocketTrait.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SocketTrait.php b/src/SocketTrait.php index 756e37c..cfa2461 100644 --- a/src/SocketTrait.php +++ b/src/SocketTrait.php @@ -62,7 +62,10 @@ trait SocketTrait if (false === $socket) { throw new ClientException('Unable to establish socket session, ' . $this->_socket_err_str); } - + + //Timeout read + stream_set_timeout($socket, $this->config('timeout')); + // Save socket to static variable $this->setSocket($socket); }