class QMqttServerConnectionProperties

The QMqttServerConnectionProperties class represents configuration options of a server a QMqttClient is connected to. More

Inheritance diagram of PySide6.QtMqtt.QMqttServerConnectionProperties

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

When a connection has been established the server might send additional details about the connection properties. Use availableProperties() to identify properties set by the server. If a property is not set by the server, default values are assumed and can be obtained by invoking access functions of this instance.

Note

Connection properties are part of the MQTT 5.0 specification and cannot be used when connecting with a lower protocol level. See ProtocolVersion for more information.

class ServerPropertyDetail

(inherits enum.Flag) This enum type specifies the available properties set by the server or the client after establishing a connection.

Constant

Description

QMqttServerConnectionProperties.None

No property has been specified.

QMqttServerConnectionProperties.SessionExpiryInterval

The number of seconds the server keeps the session after a disconnect.

QMqttServerConnectionProperties.MaximumReceive

The maximum number of QoS 1 and 2 message the server is capable of managing concurrently.

QMqttServerConnectionProperties.MaximumQoS

The maximum QoS level the server can understand.

QMqttServerConnectionProperties.RetainAvailable

Specifies whether retained messages are supported.

QMqttServerConnectionProperties.MaximumPacketSize

Specifies the maximum packet size including the message header and properties.

QMqttServerConnectionProperties.AssignedClientId

Specifies whether the server assigned a client identifier.

QMqttServerConnectionProperties.MaximumTopicAlias

Specifies the maximum amount of topic aliases.

QMqttServerConnectionProperties.ReasonString

Specifies a string providing more details on connection state.

QMqttServerConnectionProperties.UserProperty

Specifies additional user properties.

QMqttServerConnectionProperties.WildCardSupported

Specifies whether the server supports wildcard subscriptions.

QMqttServerConnectionProperties.SubscriptionIdentifierSupport

Specifies whether the server supports subscription identifiers.

QMqttServerConnectionProperties.SharedSubscriptionSupport

Specifies whether the server supports shared subscriptions.

QMqttServerConnectionProperties.ServerKeepAlive

Specifies the number of seconds the server expects a keep alive packet from the client.

QMqttServerConnectionProperties.ResponseInformation

Specifies the response information.

QMqttServerConnectionProperties.ServerReference

Specifies an alternative server address for the client to connect to.

QMqttServerConnectionProperties.AuthenticationMethod

Specifies the authentication method.

QMqttServerConnectionProperties.AuthenticationData

Specifies the authentication data.

__init__()
__init__(arg__1)
Parameters:

arg__1QMqttServerConnectionProperties

availableProperties()
Return type:

Combination of ServerPropertyDetail

Returns the available properties specified by the server.

clientIdAssigned()
Return type:

bool

Returns true if the server assigned a new client identifier to the client.

See also

clientId()

isValid()
Return type:

bool

Returns true if the server provided properties as part of the connection aknowledgment. Returns false if no properties have been provided.

maximumQoS()
Return type:

int

Returns the maximum QoS level the server supports for publishing messages. Publishing messages with QoS level exceeding the maximum QoS level reported by the server is a protocol violation.

If the client does not need to support QoS 1 or QoS 2, it should restrict the maximum QoS level in any subscription it does to a value it can support; the server would then publish messages with the maximum of supported and restricted QoS levels.

The default value is 2.

reason()
Return type:

str

Returns the reason string associated with this response.

reasonCode()
Return type:

ReasonCode

Returns the reason code associated with this response.

responseInformation()
Return type:

str

Returns the response information.

retainAvailable()
Return type:

bool

Returns true if the server accepts retained messages. The default value is true.

serverKeepAlive()
Return type:

int

Returns the number of seconds the server requested as keep alive. This overwrites the keep alive being set from the client side.

See also

setKeepAlive()

serverReference()
Return type:

str

Returns a server address which can be used by the client alternatively to connect to. Typically, this is used together with the reason code 0x9c (Use another server) or 0x9c (Server moved).

sharedSubscriptionSupported()
Return type:

bool

Returns true if the server accepts shared subscriptions. The default value is true.

subscriptionIdentifierSupported()
Return type:

bool

Returns true if the server accepts subscription identifiers. Subscription identifiers can be passed to the server when creating a new subscription.

The default value is true.

wildcardSupported()
Return type:

bool

Returns true if the server accepts subscriptions including wildcards. The default value is true.