Interface ConnectPacket

Data model of an MQTT5 CONNECT packet.

Hierarchy

Properties

clientId?: string

A unique string identifying the client to the server. Used to restore session state between connections.

If left empty, the broker will auto-assign a unique client id. When reconnecting, the mqtt5 client will always use the auto-assigned client id.

See MQTT5 Client Identifier

keepAliveIntervalSeconds: number

The maximum time interval, in seconds, that is permitted to elapse between the point at which the client finishes transmitting one MQTT packet and the point it starts sending the next. The client will use PINGREQ packets to maintain this property.

If the responding CONNACK contains a keep alive property value, then that is the negotiated keep alive value. Otherwise, the keep alive sent by the client is the negotiated value.

See MQTT5 Keep Alive

maximumPacketSizeBytes?: number

Notifies the server of the maximum packet size the client is willing to handle. If omitted, then no limit beyond the natural limits of MQTT packet size is requested.

See MQTT5 Maximum Packet Size

password?: BinaryData

Opaque binary data that the server may use for client authentication and authorization.

See MQTT5 Password

receiveMaximum?: number

Notifies the server of the maximum number of in-flight Qos 1 and 2 messages the client is willing to handle. If omitted, then no limit is requested.

See MQTT5 Receive Maximum

requestProblemInformation?: boolean

If set to true, requests that the server send additional diagnostic information (via response string or user properties) in DISCONNECT or CONNACK packets from the server.

See MQTT5 Request Problem Information

requestResponseInformation?: boolean

If set to true, requests that the server send response information in the subsequent CONNACK. This response information may be used to set up request-response implementations over MQTT, but doing so is outside the scope of the MQTT5 spec and client.

See MQTT5 Request Response Information

sessionExpiryIntervalSeconds?: number

A time interval, in seconds, that the client requests the server to persist this connection's MQTT session state for. Has no meaning if the client has not been configured to rejoin sessions. Must be non-zero in order to successfully rejoin a session.

If the responding CONNACK contains a session expiry property value, then that is the negotiated session expiry value. Otherwise, the session expiry sent by the client is the negotiated value.

See MQTT5 Session Expiry Interval

type?: PacketType

Always set on packets coming from the client to the user. Ignored if set on packets that come from the user to the client.

The primary use is to allow users to distinguish between packets in polymorphic situations (for example, the result of a publish attempt which might be a Puback (QoS 1) or Pubcomp (QoS 2, when we support it).

userProperties?: UserProperty[]

Set of MQTT5 user properties included with the packet.

See MQTT5 User Property

username?: string

A string value that the server may use for client authentication and authorization.

See MQTT5 User Name

The definition of a message to be published when the connection's session is destroyed by the server or when the will delay interval has elapsed, whichever comes first. If undefined, then nothing will be sent.

See MQTT5 Will

willDelayIntervalSeconds?: number

A time interval, in seconds, that the server should wait (for a session reconnection) before sending the will message associated with the connection's session. If omitted, the server will send the will when the associated session is destroyed. If the session is destroyed before a will delay interval has elapsed, then the will must be sent at the time of session destruction.

See MQTT5 Will Delay Interval

Generated using TypeDoc