Multiple exception bug fixes identified during testing

This commit is contained in:
Deon George
2021-10-07 23:32:05 +11:00
parent d0d6990d39
commit 83e06908b0
5 changed files with 19 additions and 6 deletions

View File

@@ -285,7 +285,15 @@ final class SocketClient {
return '';
$buf = '';
$rc = socket_recv($this->connection,$buf, $len,MSG_DONTWAIT);
try {
$rc = socket_recv($this->connection,$buf, $len,MSG_DONTWAIT);
} catch (\Exception $e) {
Log::error(sprintf('%s: - socket_recv Exception [%s]',self::LOGKEY,$e->getMessage()));
throw new SocketException($x=socket_last_error($this->connection),socket_strerror($x));
}
if ($this->DEBUG)
Log::debug(sprintf('%s: - Read [%d]',self::LOGKEY,$rc));