addServer method

void addServer(
  1. String host,
  2. int port
)

Adds a new STUN server to the pool

Implementation

void addServer(String host, int port) {
  // Check if server already exists
  if (_servers.any((s) => s.host == host && s.port == port)) {
    return;
  }

  _servers.add(
    _StunServerInfo(
      client: StunClient(
        serverHost: host,
        stunPort: port,
        timeout: timeout,
      ),
      host: host,
      port: port,
      healthScore: 50, // Start with neutral health
      lastResponseTime: null,
      lastSuccessTime: null,
      consecutiveFailures: 0,
    ),
  );
}