Interface ConnectionHandler


  • public interface ConnectionHandler
    • Method Detail

      • onMessageReceived

        void onMessageReceived​(byte[] fullMsg,
                               byte[] payload,
                               ShipConnectionInterface shipConn)
        called when a message with payload was received
        Parameters:
        fullMsg - the received full message with headers
        payload - only the payload part of the received message
        shipConn - the connection that received the message
      • onDisconnect

        void onDisconnect​(DisconnectReason reason,
                          ShipConnectionInterface shipConn)
        called when the connection is closed
        Parameters:
        reason - the reason why the connection was closed
        shipConn - the connection that was closed
      • serviceAdded

        void serviceAdded​(java.lang.String ipAddr,
                          java.lang.String ski)
        called when a service is recognized and added
        Parameters:
        ipAddr - the corresponding ip address of the service that was added
      • serviceRemoved

        void serviceRemoved​(java.lang.String ipAddr)
        called when an added service was removed
        Parameters:
        ipAddr - the corresponding ip address of the service that was removed