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{
|
public function receive() : array{
|
||||||
$size = unpack("N",socket_read($this->socket,4))[1];
|
$size = 0;
|
||||||
|
while($size == 0){
|
||||||
|
$size = unpack("N",socket_read($this->socket,4))[1];
|
||||||
|
}
|
||||||
$read = 0;
|
$read = 0;
|
||||||
$data = "";
|
$data = "";
|
||||||
$tmp = "";
|
$tmp = "";
|
||||||
|
@ -51,4 +54,9 @@
|
||||||
return json_decode($data,true);
|
return json_decode($data,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function close(){
|
||||||
|
socket_shutdown($this->socket);
|
||||||
|
socket_close($this->socket);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -60,6 +60,7 @@
|
||||||
$_SESSION['NAME'] = $check['name'];
|
$_SESSION['NAME'] = $check['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$wsi->close();
|
||||||
$wsi = null;
|
$wsi = null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue