public final class ChannelAccessVersionTCPServerMessage extends ChannelAccessVersionMessage
CA_PROTO_VERSION
message that is sent from a
server to a client via TCP. This message is usually send at the start of a
new TCP connection in order to communicate the protocol version supported by
the server.ChannelAccessCommand.CA_PROTO_VERSION
,
ChannelAccessVersionUDPMessage
,
ChannelAccessVersionTCPClientMessage
version
command, originalMessageHeader
Constructor and Description |
---|
ChannelAccessVersionTCPServerMessage(ChannelAccessVersion version)
Creates a
CA_PROTO_VERSION message. |
Modifier and Type | Method and Description |
---|---|
protected static ChannelAccessVersionTCPServerMessage |
deserialize(ChannelAccessMessageHeader messageHeader,
ByteSource byteSource)
Constructs a message from a header and a byte source.
|
protected void |
serialize(ByteSink byteSink,
ChannelAccessVersion version,
int maxPayloadSize,
Charset charset)
Serializes this message to a byte sink.
|
String |
toString()
Returns a string representation of this message.
|
equals, getVersion, hashCode
addByteArrayToStringBuilder, calculatePaddingSize, getCommand, getOriginalMessageHeader, hasOriginalMessageHeader, serializeHeader, verify, verifyHeader
public ChannelAccessVersionTCPServerMessage(ChannelAccessVersion version)
CA_PROTO_VERSION
message. This constructor should
be used to create a message that is supposed to be sent from a server to
a client using the TCP protocol.version
- Channel Access version supported by the server.protected void serialize(ByteSink byteSink, ChannelAccessVersion version, int maxPayloadSize, Charset charset)
ChannelAccessMessage
ChannelAccessMessageCodec
.serialize
in class ChannelAccessMessage
byteSink
- byte sink that is used for writing the serialized data.version
- protocol version to stay compatible with. This is the protocol
version of the peer the message is sent to.maxPayloadSize
- maximum size of the payload.charset
- encoding to use for serializing the string data (e.g. channel
names, error strings, string data-values).public String toString()
ChannelAccessMessage
toString
in class ChannelAccessMessage
protected static ChannelAccessVersionTCPServerMessage deserialize(ChannelAccessMessageHeader messageHeader, ByteSource byteSource)
ChannelAccessMessageCodec
.messageHeader
- CA message header.byteSource
- byte source for reading the message's payload (if any).BufferUnderflowException
- if there is not enough data in the byte source to read the
complete payload.Copyright © 2014–2016 aquenos GmbH. All rights reserved.