From 91ec5be991d8f0dae8941a069ad2605ca7af8c4b Mon Sep 17 00:00:00 2001 From: Wire Date: Mon, 9 Dec 2024 10:32:01 -0500 Subject: [PATCH] ignore error on closing already closed sockets --- app/Libraries/GameBridge/BridgeConnectionSocket.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Libraries/GameBridge/BridgeConnectionSocket.php b/app/Libraries/GameBridge/BridgeConnectionSocket.php index f57e3bb..8b2e976 100644 --- a/app/Libraries/GameBridge/BridgeConnectionSocket.php +++ b/app/Libraries/GameBridge/BridgeConnectionSocket.php @@ -99,7 +99,11 @@ private function connect() public function disconnect() { if ($this->socket) { - socket_close($this->socket); + try { + socket_close($this->socket); + } catch (\Throwable) { + // possible we already closed this socket + } } if ($this->lock) { $this->lock->release();