public function setLocalPort($port)
    {
        if ($port < 0 || $port > 65535 || !is_integer($port)) {
            throw new \InvalidArgumentException('Invalid port');
        }

        $this->networkLocalPort = $port;
    }