Logging updates, some function optimisation
This commit is contained in:
@@ -5,6 +5,8 @@ namespace App\Classes\Sock;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
final class SocketServer {
|
||||
private const LOGKEY = 'SS-';
|
||||
|
||||
private $server; // Our server resource
|
||||
private string $bind; // The IP address to bind to
|
||||
private int $port; // The Port to bind to
|
||||
@@ -79,12 +81,12 @@ final class SocketServer {
|
||||
if (socket_listen($this->server,$this->backlog) === FALSE)
|
||||
throw new SocketException(SocketException::CANT_LISTEN,socket_strerror(socket_last_error($this->server)));
|
||||
|
||||
Log::info(sprintf('Listening on [%s:%d]',$this->bind,$this->port),['m'=>__METHOD__]);
|
||||
Log::info(sprintf('%s:- Listening on [%s:%d]',self::LOGKEY,$this->bind,$this->port));
|
||||
|
||||
$this->loop();
|
||||
socket_close($this->server);
|
||||
|
||||
Log::info(sprintf('Closed [%s:%d]',$this->bind,$this->port),['m'=>__METHOD__]);
|
||||
Log::info(sprintf('%s:= Closed [%s:%d]',self::LOGKEY,$this->bind,$this->port));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user