Package com.biglybt.core.networkmanager
Interface IncomingMessageQueue
- All Known Implementing Classes:
IncomingMessageQueueImpl
,PeerForeignNetworkConnection.imq
public interface IncomingMessageQueue
Inbound peer message queue.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
For notification of queue events. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Cancel queue event notification listener.void
destroy()
Destroy this queue.int[]
Get the progress of the current message that is being receivedvoid
notifyOfExternallyReceivedMessage
(Message message) Notifty the queue (and its listeners) of a message received externally on the queue's behalf.int[]
receiveFromTransport
(int max_bytes, boolean protocol_is_free) Receive (read) message(s) data from the underlying transport.void
Add a listener to be notified of queue events.void
Manually resume processing (reading) incoming messages.void
setDecoder
(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.
-