sendPing method

dynamic sendPing(
  1. String mctoken
)

Implementation

sendPing(String mctoken) {
  print("this is socket $_socket");
  if (_socket != null) {
    try {
      var response = {
        "requestId": _generateMd5(
            DateTime.now().millisecondsSinceEpoch.toString() +
                tenantID +
                ref_id!),
        "requestType": "ping",
        "mcToken": mctoken,
      };
      print("this is rpc in send ping $response");
      _socket?.send(response);
    } catch (e) {
      print("this is error in close socket $e");
      onError?.call(1005, "bad state");
    }
  } else {
    print("here in onError send ping");
    onError?.call(1000, "something wrong happened");
  }
}