Class Listen

    • Method Detail

      • receiveMsg

        protected ProtocolHandshakeMsg receiveMsg()
        helper method wraps parsing in a try/catch block.
        Returns:
        the parsed SME_PROT_H message if successful, otherwise null
      • isInvalidMsg

        protected boolean isInvalidMsg​(ProtocolHandshakeMsg p,
                                       ProtocolHandshakeTypeType type)
        checks if a SME_PROT_H message is valid
        Parameters:
        p - the SME_PROT_H message
        type - the desired ProtocolHandshakeTypeType element
        Returns:
        true if the message is valid, false otherwise
      • isCompatibleVersion

        protected boolean isCompatibleVersion​(int major,
                                              int minor)
        checks if version is compatible, for now accept every version that is equal or lower than own version
        Parameters:
        major - major version number
        minor - minor version number
        Returns:
        true if version is equal or lower to own version number, false otherwise