[gnutls-help] How to handle UDP disconnection and reconnection in DTLS
Wei Cheng
chengwei.clx at gmail.com
Sat Aug 19 20:14:49 CEST 2017
DTLS and UDP are used between server and client.
I know that DTLS is connectionless and does not attempt to detect peer
failure.
question one:
if the client ends abnormally when the handshake is not over yet, how does
the server know that client is gone?
i guess that the server have to wait until the handshake timeout.
question two:
i have done two tests;
test one:
i use "atxit()" to register a function(void newclient(void)) in main();
void newclient(void)
{
sysytem("./client");
}
my push funciton as follows:
int times;
ssize_t push_func(gnutls_transport_ptr_t p, const void *data, size_t
size) { if(times++ == 4) { exit(1); } return sendto(...); }
result:
./client print "handshake timeout"
./server print "handshake timeout"
test two:
i use "atexit()" to register a function(void newclient(void)) in main();
i call "exit(1)" when the client successfully completed the handshake while
server call "gnutls_record_recv()"
result:
./client print "handshake timeout"
./server print "rev timeout"
how should i correctly use dtls to handle the udp reconnection?
i wonder if there are any examples i can refer to!
thanks in advance!
2017-08-20 1:32 GMT+08:00 Wei Cheng <chengwei.clx at gmail.com>:
> DTLS and UDP are used between server and client.
>
> I know that DTLS is connectionless and does not attempt to detect peer
> failure.
>
> question one:
> if the client ends abnormally when the handshake is not over yet, how does
> the server know that client is gone?
> i guess that the server have to wait until the handshake timeout.
>
> question two:
> i have done two test.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20170820/2a1f8953/attachment.html>
More information about the Gnutls-help
mailing list