diff --git a/lib/src/binding_coap/coap_client.dart b/lib/src/binding_coap/coap_client.dart index 2a662dfe..c90844b1 100644 --- a/lib/src/binding_coap/coap_client.dart +++ b/lib/src/binding_coap/coap_client.dart @@ -175,6 +175,7 @@ final class CoapClient extends ProtocolClient form, pskCredentialsCallback: _pskCredentialsCallback, ), + initTimeout: _coapConfig?.initTimeout ?? const Duration(seconds: 10), ); final request = await _createRequest( diff --git a/lib/src/binding_coap/coap_config.dart b/lib/src/binding_coap/coap_config.dart index a1cad6ef..62d8574b 100644 --- a/lib/src/binding_coap/coap_config.dart +++ b/lib/src/binding_coap/coap_config.dart @@ -26,8 +26,11 @@ class CoapConfig { this.clientCertificate, this.clientPrivateKey, this.verifyPrivateKey = false, + this.initTimeout, }); + final Duration? initTimeout; + /// Whether certificates should be verified by OpenSSL. final bool dtlsVerify;