close function

bool close()

Closes the socket to the RCON server. Returns a bool that specified whether the socket was successfully destroyed.

Implementation

bool close() {
  // Checks to ensure that the RCON socket exists.
  if (rconSck == null) {
    return false;
  }

  // Destroys the socket, which also closes the connection.
  rconSck!.destroy();

  return true;
}