Package convex.net
Class MessageSender
java.lang.Object
convex.net.MessageSender
Message sender responsible for moving bytes from a ByteBuffer to a ByteChannel
Must call maybeSendBytes to attempt to flush buffer to channel.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Logger
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
bufferMessage
(ByteBuffer messageFrame) Buffers a message for sending.boolean
Try to send bytes on the outbound channel.
-
Field Details
-
SEND_BUFFER_SIZE
public static final int SEND_BUFFER_SIZE- See Also:
-
log
protected static final org.slf4j.Logger log
-
-
Constructor Details
-
MessageSender
-
-
Method Details
-
bufferMessage
Buffers a message for sending.- Parameters:
messageFrame
- Source ByteBuffer containing complete message bytes (including length)- Returns:
- True if successfully buffered, false otherwise (insufficient send buffer size)
-
maybeSendBytes
Try to send bytes on the outbound channel.- Returns:
- True if all bytes have been sent, false otherwise.
- Throws:
IOException
- If IO error occurs
-