function free($socket) { unset($this->sockets[array_search($socket, $this->sockets)]); unset($this->agents[(int) $socket]); $this->close($socket); }