/** * @param Socket $socket * * @return bool */ public function equals(Socket $socket) : bool { if (!$socket instanceof $this) { return FALSE; } if ($this->getHost() != $socket->getHost()) { return FALSE; } if ($this->getPort() != $socket->getPort()) { return FALSE; } return TRUE; }