Small fix
This commit is contained in:
parent
a5231d43bd
commit
8a3cc16d53
@ -24,6 +24,11 @@ if (!extension_loaded('pthreads')) {
|
|||||||
$this->sock = socket_create($domain, $type, $protocol);
|
$this->sock = socket_create($domain, $type, $protocol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function __destruct()
|
||||||
|
{
|
||||||
|
socket_close($this->sock);
|
||||||
|
}
|
||||||
|
|
||||||
public function setOption(int $level, int $name, $value)
|
public function setOption(int $level, int $name, $value)
|
||||||
{
|
{
|
||||||
if (in_array($name, [\SO_RCVTIMEO, \SO_SNDTIMEO])) {
|
if (in_array($name, [\SO_RCVTIMEO, \SO_SNDTIMEO])) {
|
||||||
@ -129,6 +134,9 @@ if (!extension_loaded('pthreads')) {
|
|||||||
{
|
{
|
||||||
$this->protocol = getprotobynumber($protocol);
|
$this->protocol = getprotobynumber($protocol);
|
||||||
}
|
}
|
||||||
|
public function __destruct() {
|
||||||
|
if ($this->sock !== NULL) fclose($this->sock);
|
||||||
|
}
|
||||||
|
|
||||||
public function setOption(int $level, int $name, $value)
|
public function setOption(int $level, int $name, $value)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user