sendPong method

Future sendPong()

Implementation

Future sendPong() async {
  var pONG = Uint8List(7);
  var pONGBODY = Uint8List(4);
  pONGBODY[0] = 80;
  pONGBODY[1] = 79;
  pONGBODY[2] = 78;
  pONGBODY[3] = 71;
  pONG[0] = PONG_TYPE;
  pONG[1] = (pONGBODY.length & 0xff);
  pONG[2] = ((pONGBODY.length >> 8) & 0xff);
  pONG.setRange(3, 6, pONGBODY);
  socket!.add(pONG);
  await socket!.flush();
  if (timer.isActive()) {
    timer.cancel();
  }
}