Interface NetworkClientCallback<T>

    • Method Detail

      • onMessage

        void onMessage​(NetworkMessage<T> message,
                       NetworkClient<T> client)
                throws IOException
        Called when a new message is received from the server.
        Parameters:
        message - Message.
        client - Client that received this message.
        Throws:
        IOException - Message handling error.
      • onConnect

        default void onConnect​(NetworkClient<T> client)
        Called upon successful completion of connect operation right after client switches to the CONNECTED state.

        Note that this method will not be called in case of connect operation failure, onDisconnect(NetworkClient, Optional) method will be called instead with a non-empty cause.

        Parameters:
        client - Client that was connected.