public abstract class StreamedControlChannel extends AbstractControlChannel
Control messages sent by this channel are given their length as a header, so that they are easily extractable by the communication partner.
Modifier and Type | Field and Description |
---|---|
private boolean |
m_bIsEncrypted |
private int |
m_currentIndex
Is initialized to -2, to account for the 2 preceding length bytes
of a message.
|
private byte[] |
m_lengthBuffer |
private byte[] |
m_messageBuffer |
m_parentMultiplexer
Constructor and Description |
---|
StreamedControlChannel(int a_channelId,
Multiplexer a_multiplexer,
IServiceContainer a_serviceContainer,
boolean bEncrypted) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
processMessage(byte[] a_message) |
protected void |
processPacketData(byte[] a_packetData)
Takes an array of bytes, which could contain multiple control messages
and extracts, decrypts (if necessary) and processes them in the order
they appear in.
|
int |
sendByteMessage(byte[] a_message)
Adds the length of the given buffer to the front of the byte array and
sends it.
|
getServiceContainer, isSending, processReceivedPacket, sendRawMessage
createEmptyMixPacket, deleteChannel, isClosed, multiplexerClosed, sendPacket
private byte[] m_messageBuffer
private int m_currentIndex
private byte[] m_lengthBuffer
private boolean m_bIsEncrypted
public StreamedControlChannel(int a_channelId, Multiplexer a_multiplexer, IServiceContainer a_serviceContainer, boolean bEncrypted)
public int sendByteMessage(byte[] a_message)
If encryption is used, the byte array will be encrypted using GCM before sending.
a_message
- protected void processPacketData(byte[] a_packetData)
processPacketData
in class AbstractControlChannel
protected abstract void processMessage(byte[] a_message)
Copyright © 2023. All rights reserved.