Skip to content

Commit

Permalink
fix issue #22
Browse files Browse the repository at this point in the history
  • Loading branch information
glushkovds authored May 22, 2024
1 parent d8d8b8d commit 4868ceb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Transport/SocketTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ public function open()
$r = @socket_connect($socket6, $ip, $port);
if ($r) {
if ($this->debug) call_user_func($this->debugHandler, "Connected to $ip:$port!");
@socket_close($socket4);
if (!empty($socket4)) {
@socket_close($socket4);
}
$this->socket = $socket6;
return;
} elseif ($this->debug) {
Expand All @@ -253,7 +255,9 @@ public function open()
$r = @socket_connect($socket4, $ip, $port);
if ($r) {
if ($this->debug) call_user_func($this->debugHandler, "Connected to $ip:$port!");
@socket_close($socket6);
if (!empty($socket6)) {
@socket_close($socket6);
}
$this->socket = $socket4;
return;
} elseif ($this->debug) {
Expand Down

0 comments on commit 4868ceb

Please sign in to comment.