MqttSynchronousServerConnectionHandler constructor

MqttSynchronousServerConnectionHandler(
  1. dynamic clientEventBus, {
  2. required int maxConnectionAttempts,
  3. required dynamic socketOptions,
  4. required dynamic socketTimeout,
})

Initializes a new instance of the SynchronousMqttConnectionHandler class.

Implementation

MqttSynchronousServerConnectionHandler(
  clientEventBus, {
  required int maxConnectionAttempts,
  required socketOptions,
  required socketTimeout,
}) : super(
       clientEventBus,
       maxConnectionAttempts: maxConnectionAttempts,
       socketOptions: socketOptions,
       socketTimeout: socketTimeout,
     ) {
  this.clientEventBus = clientEventBus;
  connectTimer = socketTimeout == null
      ? MqttCancellableAsyncSleep(
          MqttConstants.defaultConnectionAttemptTimeoutPeriod,
        )
      : MqttCancellableAsyncSleep(
          MqttConstants.disabledConnectionAttemptTimeoutPeriod,
        );
  initialiseListeners();
}