Fix binkp remote closing connection, add/delete session details, menu item this system, minor CSS fixes, move system form editing to individual files

This commit is contained in:
Deon George
2021-07-04 21:47:23 +10:00
parent d56681a187
commit acfde97e79
21 changed files with 1293 additions and 655 deletions

View File

@@ -300,8 +300,15 @@ final class SocketClient {
throw new SocketException($x=socket_last_error($this->connection),socket_strerror($x));
// If our buffer is null, see if we have any out of band data.
if (($rc == 0) && is_nulL($buf) && ($this->hasData(0) > 0))
socket_recv($this->connection,$buf, $len,MSG_OOB);
// @todo We throw an errorexception when the socket is closed by the remote I think.
if (($rc == 0) && is_nulL($buf) && ($this->hasData(0) > 0)) {
try {
socket_recv($this->connection,$buf, $len,MSG_OOB);
} catch (\Exception $e) {
throw new SocketException($x=socket_last_error($this->connection),socket_strerror($x));
}
}
return is_null($buf) ? '' : $buf;
}

View File

@@ -10,6 +10,7 @@ final class SocketException extends \Exception {
public const CANT_CONNECT = 5;
public const SOCKET_ERROR = 6;
public const SOCKET_EAGAIN = 11;
public const SOCKET_READ = 22;
private array $messages = [
self::CANT_CREATE_SOCKET => 'Can\'t create socket: "%s"',
@@ -19,6 +20,7 @@ final class SocketException extends \Exception {
self::CANT_CONNECT => 'Can\'t connect: "%s"',
self::SOCKET_ERROR => 'Socket Error: "%s"',
self::SOCKET_EAGAIN => 'Socket Resource Temporarily Unavailable - Try again',
self::SOCKET_READ => 'Unable to read from socket',
];
public function __construct(int $code,string $params=NULL) {