KAATcpConnect Class Reference
Inherits from | KAAMqttFrame : NSObject |
---|---|
Declared in | KAATcpConnect.h KAATcpConnect.m |
Overview
Connect message class.
When a TCP/IP socket connection is established from a client to a server,
a protocol level session must be created using a CONNECT flow.
Variable header
Protocol Name
byte 1 Length MSB (0)
byte 2 Length LSB (6)
byte 3 K
byte 4 a
byte 5 a
byte 6 t
byte 7 c
byte 8 p
Protocol version
byte 9 Version (1)
Connect Flags
byte 10
User name flag (0)
Password flag (0)
Will RETAIN (0)
Will QoS (00)
Will flag (0)
Clean Session (1)
0x02 - value
Keep Alive timer
byte 11 Keep alive MSB (0)
byte 12 Keep alive LSB (200)
Keep Alive timer - default value 200 seconds.
Payload:
Session Key: AES Session encoding key (16 byte) - encrypted with the Operations server RSA Public Key
EndpointPublicKeyHash: SHA Hash of Endpoint Public Key (32 byte)
Signature: RSA signature (32 byte) signed with the Endpoint Private Key of Session key (16 byte) + EndpointPublicKeyHash (32 byte)
– pack
Pack message into mqtt frame
- (void)pack
Discussion
Pack message into mqtt frame
Declared In
KAAMqttFrame.h
– decode
Decode message from mqttFrame buffer
- (void)decode
Discussion
Decode message from mqttFrame buffer
Exceptions
KaaTcpProtocolException |
TCP exception |
---|
Declared In
KAAMqttFrame.h
– needToCloseConnection
Check if this Mqtt frame should be last frame on connection and connection should be closed.
- (BOOL)needToCloseConnection
Return Value
YES if connection should be closed after frame transmition.
Discussion
Check if this Mqtt frame should be last frame on connection and connection should be closed.
Declared In
KAAMqttFrame.h