CommunicationOptions

public class CommunicationOptions

Options used for communication

  • Namespace used to isolate different Coaty applications (optional).

    Communication events are only routed between agents within a common communication namespace.

    A namespace string must not contain the following characters: NULL (U+0000), # (U+0023), + (U+002B), / (U+002F).

    If not specified or empty, a default namespace named “-” is used.

    Declaration

    Swift

    public var namespace: String?
  • Determines whether to enable cross-namespace communication between agents in special use cases (optional).

    If true, an agent receives communication events published by any agent in the same networking infrastructure, regardless of namespace.

    This option’s value defaults to false.

    Declaration

    Swift

    public var shouldEnableCrossNamespacing: Bool
  • Options to connect with CocoaMQTT client to broker.

    Declaration

    Swift

    public var mqttClientOptions: MQTTClientOptions?
  • Determines whether the communication manager should start initially when the container has been resolved. Its value defaults to false.

    Declaration

    Swift

    public var shouldAutoStart: Bool
  • Determines whether the communication manager should provide a protocol compliant client ID when connecting to the broker/router.

    If not specified, the value of this option defaults to false.

    For example, MQTT Spec 3.1 states that the broker MUST allow Client IDs which are between 1 and 23 UTF-8 encoded bytes in length, and that contain only the characters “0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ”. However, broker implementations are free to allow non-compliant Client IDs.

    By default, non-compliant Client IDs of the form “Coaty” are used where specifies the objectId of the communication manager’s identity object. If you experience issues with a specific broker, specify this option as true.

    Declaration

    Swift

    @available(*, deprecated)
    public var useProtocolCompliantClientId: Bool
  • Create a new CommunicationOptions instance.

    Declaration

    Swift

    public init(namespace: String? = nil,
    
                shouldEnableCrossNamespacing: Bool? = nil,
    
                mqttClientOptions: MQTTClientOptions? = nil,
    
                shouldAutoStart: Bool? = nil,
    
                useProtocolCompliantClientId: Bool? = nil)