nabto_device_limit_connections()
DESCRIPTION
Limit maximum number of concurrent client connections.
If the connection limit is reached, a DTLS alert “internal_error” is returned to the client. The client sdk returns NABTO_CLIENT_EC_DEVICE_INTERNAL_ERROR
.
Dtls “internal_error” is defined in RFC 8446 as
“internal_error: An internal error unrelated to the peer or the correctness of the protocol (such as a memory allocation failure) makes it impossible to continue.”
In practice this means it will only occur when the device runs out of resources. The device could run out of resources without the connection limit being reached if the limit is larger than available memory at the time of the connection.
DECLARATION
NABTO_DEVICE_DECL_PREFIX NabtoDeviceError NABTO_DEVICE_API
nabto_device_limit_connections(NabtoDevice* device, size_t limit)
PARAMETERS
device:
- [in] The device.
limit:
- [in] The maximum number of concurrent connections.
RETURNS
NABTO_DEVICE_EC_OK iff ok