<p></p>
<blockquote>
<p>BTW: IMHO <code>sock_dtls_close()</code> should also close the UDP sock to</p>
<pre><code>1. prevent accidental unencrypted communication, once the DTLS sock is closed

2. Not needing to keep the pointer stored in the application as I currently do.
</code></pre>
</blockquote>
<p>After re-reading the documentation I think I agree with what is written <a href="https://doc.riot-os.org/group__net__sock__dtls.html#details" rel="nofollow">there</a>:</p>
<blockquote>
<p>sock_dtls_create() and sock_dtls_close() only manages the DTLS layer. That means we still have to clean up the created UDP sock from before by calling sock_udp_close() on our UDP sock in case of error or we reached the end of the application.</p>
</blockquote>
<p>So I go for the getter solution instead.</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/12907#issuecomment-634203050">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYCXBI4SYVHU3D6H6NTRTQD47ANCNFSM4JYIYHQA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABE7WYH7UU6DBIWPP7ULQYDRTQD47A5CNFSM4JYIYHQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEXGSXKQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/12907#issuecomment-634203050",
"url": "https://github.com/RIOT-OS/RIOT/pull/12907#issuecomment-634203050",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>