The Server replies to an hello message with an ack message.
The hello and acknowledge messages are used to negotiate buffer size, message size, and the maximum number of chunks per message to use. The fields are identical to the hello message, only the MessageType is now ‘ACK’ and the EndpointUrl is not needed.
So the ACK message contains the following fields:
Parameter | Datatype | Value | Comments |
---|---|---|---|
MessageType | 3 ACII bytes | ACK | from acknowledge |
IsFinal | 1 ASCII byte | F | from final |
MessageSize | ULInt32 | 32 (fixed size!) | |
ProtocolVersion | ULInt32 | 0 | uncertified stack |
ReceiverBufferSize | ULInt32 | 65536 | |
SendBufferSize | ULInt32 | 65536 | |
MaxMessageSize | ULInt32 | 0 | unlimited |
MaxChunkCount | ULInt32 | 0 | unlimited |
Using Construct we can create a struct, containing these fields.
from construct import *
c = Struct('OPC UA TCP Acknowledge Message',
String('MessageType', 3),
String('Reserved', 1),
ULInt32('MessageSize'),
ULInt32('ProtocolVersion'),
ULInt32('ReceiveBufferSize'),
ULInt32('SendBufferSize'),
ULInt32('MaxMessageSize'),
ULInt32('MaxChunkCount'),
)