<pre><code>* Why is there a need for `dtls/dsm` - can't we attach the session directly to the socket?
<p>Like mentioned in one conversation comment, the distribution how the maximum number of sessions <code>DTLS_PEER_MAX</code> is distributed to individual sockets is unknown. In some place, currently existing sessions must be held. Keeping actual sessions could of course be done in the implementation of the respective DTLS library. My decision here was to provide a simple generic way to hold sessions without each application/library implementation having to find its own solution.</p>
<p>Additionally, I have a scenario in mind: cross-application session management. Possibly a bit too far thought, but I can definitely see problems if an application can theoretically "occupy" all sessions indefinitely or for a very long time. By this I mean that e.g. <code>DTLS_PEER_MAX</code> sessions are occupied by gcoap. As a result, all other applications using DTLS have no possibility to establish connections or to receive incoming connections (kind of resource deadlock) on their sockets.</p>
<p>Right now dsm does not help here, but is very easy to extend to get access to sessions stored by others and close them to free peer resources. Provided dsm is used for storage by the respective applications.</p>
<p>Although I have built in the mechanism with gcoap for this very reason that sessions are automatically freed, but I consider the basic scenario with multiple DTLS applications far from impossible.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/15549#issuecomment-840766068">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYF2S3VMGKWNOIFXEH3TNQOVJANCNFSM4UL2PR7Q">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABE7WYEKRRPXIVBFX56OGNLTNQOVJA5CNFSM4UL2PR72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGIORE5A.gif" height="1" width="1" alt="" /></p>
"name": "View Pull Request"
"description": "View this Pull Request on GitHub",