@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | $sendTimeout = socket_get_option($this->socket, SOL_SOCKET, SO_SNDTIMEO); |
38 | 38 | $receiveTimeout = socket_get_option($this->socket, SOL_SOCKET, SO_RCVTIMEO); |
39 | 39 | socket_set_option($this->socket, SOL_TCP, SO_KEEPALIVE, 1); |
40 | - socket_set_option($this->socket, SOL_SOCKET,SO_SNDTIMEO, $timeout); |
|
41 | - socket_set_option($this->socket, SOL_SOCKET,SO_RCVTIMEO, $timeout); |
|
40 | + socket_set_option($this->socket, SOL_SOCKET, SO_SNDTIMEO, $timeout); |
|
41 | + socket_set_option($this->socket, SOL_SOCKET, SO_RCVTIMEO, $timeout); |
|
42 | 42 | socket_set_block($this->socket); |
43 | 43 | |
44 | 44 | $address = gethostbyname($host); |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | throw new ConnectionException($error, socket_strerror($error)); |
48 | 48 | }; |
49 | 49 | |
50 | - socket_set_option($this->socket, SOL_SOCKET,SO_SNDTIMEO, $sendTimeout); |
|
51 | - socket_set_option($this->socket, SOL_SOCKET,SO_RCVTIMEO, $receiveTimeout); |
|
50 | + socket_set_option($this->socket, SOL_SOCKET, SO_SNDTIMEO, $sendTimeout); |
|
51 | + socket_set_option($this->socket, SOL_SOCKET, SO_RCVTIMEO, $receiveTimeout); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $buffer = ''; |
112 | 112 | // Reading stops at \r or \n. In case it stopped at \r we must continue reading. |
113 | - while(substr($buffer, -1, 1) !== "\n") { |
|
113 | + while (substr($buffer, -1, 1) !== "\n") { |
|
114 | 114 | $result = socket_read($this->socket, 1024, PHP_NORMAL_READ); |
115 | 115 | if ($result === false) { |
116 | 116 | $this->throwException(); |