sendData static method

Future<bool> sendData(
  1. DtlsData dtlsData,
  2. List<int> packet
)

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;
}