Interface Receiver

All Known Implementing Classes:
BasicTCP, DiagnosticsHandler, FD_SOCK2, GossipRouter, PubClient, PubServer, ReceiverAdapter, RouterStub, ServerTransport, TCP, TCP_NIO2

public interface Receiver
Receiver interface to be used with BaseServer instances
Since:
3.6.5
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    receive(Address sender, byte[] buf, int offset, int length)
    Delivers a message from a given sender to the application
    default void
    receive(Address sender, DataInput in)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    receive(Address sender, DataInput in, int length)
    Receive data from the given sender
    default void
    receive(Address sender, ByteBuffer buf)
    Delivers a message from a given sender to the application
  • Method Details

    • receive

      void receive(Address sender, byte[] buf, int offset, int length)
      Delivers a message from a given sender to the application
      Parameters:
      sender - The sender of the message
      buf - The buffer. An application typically de-serializes data from the buffer into objects used by the application. Note that when receive() returns, it is not safe to use the buffer any longer; if an application needs to use a buffer after this callback returns, it must make a copy.
      offset - The offset at which the received data starts
      length - The length of the received data
    • receive

      default void receive(Address sender, ByteBuffer buf)
      Delivers a message from a given sender to the application
      Parameters:
      sender - The sender of the message
      buf - The buffer. An application typically de-serializes data from the buffer into objects used by the application. Note that when receive() returns, it is not safe to use the buffer any longer; if an application needs to use a buffer after this callback returns, it must make a copy.

      Note that buf could be a direct ByteBuffer.

    • receive

      @Deprecated(since="5.3.3", forRemoval=true) default void receive(Address sender, DataInput in) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      Exception
    • receive

      default void receive(Address sender, DataInput in, int length) throws Exception
      Receive data from the given sender
      Parameters:
      sender - The sender
      in - The data input from which to read
      length - The number of bytes to read
      Throws:
      Exception