If there are buffered unread bytes, socket is switched to non-blocking mode (stream_set_blocking($this->socket, false)). However, next receive()s will return empty buffer if there are no data to be read, because socket remains on non-blocking mode. This fix switches socket back to blocking mode after next read.
If there are buffered unread bytes, socket is switched to non-blocking mode (
stream_set_blocking($this->socket, false)
). However, nextreceive()
s will return empty buffer if there are no data to be read, because socket remains on non-blocking mode. This fix switches socket back to blocking mode after next read.