Fix the bug that DTLS exits with an Exception.