Implemented file sending during BINKP and EMSI sessions

This commit is contained in:
2023-06-22 17:36:22 +10:00
parent 58341db0fb
commit b1b86ca04a
14 changed files with 308 additions and 82 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Classes\Sock;
// @todo Can we change this to use socket_strerr() && socket_last_error()
final class SocketException extends \Exception {
public const CANT_CREATE_SOCKET = 1;
public const CANT_BIND_SOCKET = 2;
@@ -11,6 +12,7 @@ final class SocketException extends \Exception {
public const SOCKET_ERROR = 6;
public const SOCKET_EAGAIN = 11;
public const SOCKET_READ = 22;
public const CONNECTION_RESET = 104;
private array $messages = [
self::CANT_CREATE_SOCKET => 'Can\'t create socket: "%s"',
@@ -21,6 +23,7 @@ final class SocketException extends \Exception {
self::SOCKET_ERROR => 'Socket Error: "%s"',
self::SOCKET_EAGAIN => 'Socket Resource Temporarily Unavailable - Try again',
self::SOCKET_READ => 'Unable to read from socket',
self::CONNECTION_RESET => 'Connection reset by peer',
];
public function __construct(int $code,string $params=NULL) {