public function close() { if ($this->socket !== null) { socket_close($this->socket); } return true; }