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;
  if (socketTimeout == null) {
    connectTimer = MqttCancellableAsyncSleep(5000);
  } else {
    connectTimer = MqttCancellableAsyncSleep(10);
  }
  initialiseListeners();
}