Interface LocalTransport


  • public interface LocalTransport
    A local transport is used for sending messages only to single (or all) members of the same host.
    Since:
    5.2.0
    Author:
    Bela Ban
    • Method Detail

      • init

        LocalTransport init​(TP transport)
                     throws java.lang.Exception
        Calls after the local transport has been created.
        Parameters:
        transport - A reference to TP
        Throws:
        java.lang.Exception
      • start

        LocalTransport start()
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isLocalMember

        boolean isLocalMember​(Address addr)
        Returns true if addr is a local member, false otherwise
      • sendTo

        void sendTo​(Address dest,
                    byte[] buf,
                    int offset,
                    int length)
             throws java.lang.Exception
        Sends a message to a given local member. The caller should check before whether dest is a local member; an implementation is not required to do so, but may nevertheless perform the check (and throw an exception if the destination is not local).
        Parameters:
        dest - The address of the member to which to send the message. Must be non-null
        buf - The buffer to send
        offset - The offset at which the data starts
        length - The number of bytes to send
        Throws:
        java.lang.Exception - Thrown when the send failed, e.g. when dest isn't a local address.
      • sendToAll

        void sendToAll​(byte[] buf,
                       int offset,
                       int length)
                throws java.lang.Exception
        Sends a message to all local members.
        Parameters:
        buf - The buffer to send
        offset - The offset at which the data starts
        length - The number of bytes to send
        Throws:
        java.lang.Exception - Thrown when the send failed.