Skip to content

Commit

Permalink
avoid warning and crash
Browse files Browse the repository at this point in the history
jacob-grahn committed Sep 22, 2024
1 parent 1c8bb80 commit 32a9036
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 0 additions & 4 deletions vend/socket/SocketClient.php
Original file line number Diff line number Diff line change
@@ -58,9 +58,7 @@ public function doWrite()
$this->onWrite();
return true;
} catch (\Exception $e) {
$old_socket = spl_object_id($this->socket);
$this->close();
$this->socket = $old_socket;
$this->disconnected = true;
$this->onDisconnect();
return false;
@@ -74,9 +72,7 @@ public function read($length = 4096)
$this->read_buffer .= parent::read($length);
$this->onRead();
} catch (\Exception $e) {
$old_socket = spl_object_id($this->socket);
$this->close();
$this->socket = $old_socket;
$this->disconnected = true;
$this->onDisconnect();
}
1 change: 1 addition & 0 deletions vend/socket/SocketServer.php
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@
abstract class SocketServer extends Socket
{
protected $client_class;
public $disconnected = false;

public function __construct(
$client_class,

0 comments on commit 32a9036

Please sign in to comment.