sendData static method
Sends the packet
through the DTLS connection in dtlsData
.
Returns true
if the data was send successfully; otherwise, false.
Implementation
static Future<bool> sendData(DtlsData dtlsData, List<int> packet) async {
try {
dtlsData.connection!.send(packet);
} catch (e) {
// Connection has been cut at this point.
return false;
}
return true;
}