Interface ITransport<Con>

    • Method Detail

      • init

        void init​(ITransportHandler<Con> handler)
        Initialize the transport. To be called once, before any other method.
        Parameters:
        handler - The transport handler with callback methods.
      • shutdown

        void shutdown()
        Shutdown and free all resources. To be called once, as last method.
      • getProtocolName

        java.lang.String getProtocolName()
        Get the protocol name.
      • openPort

        IFuture<java.lang.Integer> openPort​(int port)
        Open a port to accept connections.
        Parameters:
        port - The (positive) port or 0 for any port.
        Returns:
        A future holding the actual port, once the server is running.
      • createConnection

        IFuture<Con> createConnection​(java.lang.String address,
                                      IComponentIdentifier target)
        Create a connection to a given address.
        Parameters:
        address - The target platform's address.
        target - The target identifier to maybe perform authentication of the connection.
        Returns:
        A future containing the connection when succeeded.
      • closeConnection

        void closeConnection​(Con con)
        Perform close operations on a connection. Potentially cleans up key attachments as well.
      • sendMessage

        IFuture<java.lang.Integer> sendMessage​(Con con,
                                               byte[] header,
                                               byte[] body)
        Send bytes using the given connection.
        Parameters:
        sc - The connection.
        header - The message header.
        body - The message body.
        Returns:
        A future indicating success and the current transport priority.