public function getPort(): int
    {
        $name = $this->getName();

        if ($name) {
            return (int)self::getNamePart($name, self::NAME_PART_PORT);
        } else {
            throw new SocketException('Cannot get socket IP address');
        }
    }
public function getPort(): int
    {
        $name = $this->getName();

        if ($name) {
            return (int)self::getNamePart($name, self::NAME_PART_PORT);
        } else {
            throw new SocketException('Cannot get socket IP address');
        }
    }
public function getPort ( ) : int { $ name = $ this -> getName ( ) ; if ( $ name ) { return ( int ) self :: getNamePart ( $ name , self :: NAME_PART_PORT ) ; } else { throw new SocketException ( 'Cannot get socket IP address' ) ; } }
Gets the port of the socket

@throws \Wrench\Exception\SocketException If the port cannot be obtained
@return int
Gets the port of the socket