Interface IncomingMessageQueue
- All Known Implementing Classes:
IncomingMessageQueueImpl, PeerForeignNetworkConnection.imq
public interface IncomingMessageQueue
Inbound peer message queue.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFor notification of queue events. -
Method Summary
Modifier and TypeMethodDescriptionvoidCancel queue event notification listener.voiddestroy()Destroy this queue.int[]Get the progress of the current message that is being receivedvoidnotifyOfExternallyReceivedMessage(Message message) Notifty the queue (and its listeners) of a message received externally on the queue's behalf.long[]receiveFromTransport(long max_bytes, boolean protocol_is_free) Receive (read) message(s) data from the underlying transport.voidAdd a listener to be notified of queue events.voidManually resume processing (reading) incoming messages.voidsetDecoder(MessageStreamDecoder new_stream_decoder) Set the message stream decoder that will be used to decode incoming messages.
-
Method Details
-
setDecoder
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
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
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
Add a listener to be notified of queue events.- Parameters:
listener-
-
cancelQueueListener
Cancel queue event notification listener.- Parameters:
listener-
-
destroy
void destroy()Destroy this queue.
-