This commit is contained in:
2020-10-09 17:21:44 +08:00
parent e72effee14
commit 8c2e375a1f
+13 -9
View File
@@ -248,15 +248,19 @@ class Socket
$this->readWatcher = \Amp\onReadable($this->stream, function () {
do {
if(!$this->isSocketDead($this->stream)){
$newData = @fread($this->stream, self::READ_MAX_LEN);
}else{
$this->reconnect();
return;
}
if ($newData) {
$this->read($newData);
}
try {
if(!$this->isSocketDead($this->stream)){
$newData = @fread($this->stream, self::READ_MAX_LEN);
}else{
$this->reconnect();
return;
}
if ($newData) {
$this->read($newData);
}
}catch (\Exception $exception){
var_dump($exception->getMessage());
}
} while ($newData);
});