$pre = null;
while (TRUE) {
$buf = @fread($this->handle_, $len);
- if ($buf === FALSE || $buf === '') {
+ if ($buf === FALSE) {
$md = stream_get_meta_data($this->handle_);
- if ($md['timed_out']) {
+ if (true === $md['timed_out'] && false === $md['blocked']) {
throw new TTransportException('TSocket: timed out reading '.$len.' bytes from '.
$this->host_.':'.$this->port_);
} else {
}
} else if (($sz = strlen($buf)) < $len) {
$md = stream_get_meta_data($this->handle_);
- if ($md['timed_out']) {
+ if (true === $md['timed_out'] && false === $md['blocked']) {
throw new TTransportException('TSocket: timed out reading '.$len.' bytes from '.
$this->host_.':'.$this->port_);
} else {
$this->sendTimeoutSet_ = FALSE;
}
$data = @fread($this->handle_, $len);
- if ($data === FALSE || $data === '') {
+ if ($data === FALSE) {
$md = stream_get_meta_data($this->handle_);
- if ($md['timed_out']) {
+ if (true === $md['timed_out'] && false === $md['blocked']) {
throw new TTransportException('TSocket: timed out reading '.$len.' bytes from '.
$this->host_.':'.$this->port_);
} else {