fix: Interop not closing socket + discard keepalive packets
This commit is contained in:
parent
5d9e6ef83f
commit
4f6fa13155
|
@ -35,7 +35,10 @@
|
|||
}
|
||||
|
||||
public function receive() : array{
|
||||
$size = 0;
|
||||
while($size == 0){
|
||||
$size = unpack("N",socket_read($this->socket,4))[1];
|
||||
}
|
||||
$read = 0;
|
||||
$data = "";
|
||||
$tmp = "";
|
||||
|
@ -51,4 +54,9 @@
|
|||
return json_decode($data,true);
|
||||
}
|
||||
|
||||
public function close(){
|
||||
socket_shutdown($this->socket);
|
||||
socket_close($this->socket);
|
||||
}
|
||||
|
||||
}
|
|
@ -60,6 +60,7 @@
|
|||
$_SESSION['NAME'] = $check['name'];
|
||||
}
|
||||
|
||||
$wsi->close();
|
||||
$wsi = null;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue