Interface IncomingMessageQueue

All Known Implementing Classes:
IncomingMessageQueueImpl, PeerForeignNetworkConnection.imq

public interface IncomingMessageQueue
Inbound peer message queue.
  • Method Details

    • setDecoder

      void setDecoder(MessageStreamDecoder new_stream_decoder)
      Set the message stream decoder that will be used to decode incoming messages.
      Parameters:
      new_stream_decoder - to use
    • getDecoder

      MessageStreamDecoder getDecoder()
    • getCurrentMessageProgress

      int[] getCurrentMessageProgress()
      Get the progress of the current message that is being received
      Returns:
      [size, done] or null
    • receiveFromTransport

      int[] receiveFromTransport(int max_bytes, boolean protocol_is_free) throws IOException
      Receive (read) message(s) data from the underlying transport.
      Parameters:
      max_bytes - to read
      Returns:
      number of bytes received as [data, protocol]
      Throws:
      IOException - on receive error
    • notifyOfExternallyReceivedMessage

      void notifyOfExternallyReceivedMessage(Message message) throws IOException
      Notifty the queue (and its listeners) of a message received externally on the queue's behalf.
      Parameters:
      message - received externally
      Throws:
      IOException
    • resumeQueueProcessing

      void resumeQueueProcessing()
      Manually resume processing (reading) incoming messages. NOTE: Allows us to resume docoding externally, in case it was auto-paused internally.
    • registerQueueListener

      void registerQueueListener(IncomingMessageQueue.MessageQueueListener listener)
      Add a listener to be notified of queue events.
      Parameters:
      listener -
    • cancelQueueListener

      void cancelQueueListener(IncomingMessageQueue.MessageQueueListener listener)
      Cancel queue event notification listener.
      Parameters:
      listener -
    • destroy

      void destroy()
      Destroy this queue.