sendCloseToRelay method

void sendCloseToRelay(
  1. String url,
  2. String id
)

Implementation

void sendCloseToRelay(String url, String id) {
  if (isWebSocketOpen(url)) {
    try {
      Relay? relay = getRelay(url);
      if (relay != null) {
        relay.stats.activeRequests--;
      }
      send(url, jsonEncode(["CLOSE", id]));
      logActiveRequests();
    } catch (e) {
      print(e);
    }
  }
}