public SingleServerProvider(Uri url) { if (url == null) { throw new ArgumentNullException(nameof(url)); } _connection = new ConnectionDescriptor(url) { KeepAlive = true }; }
public ConnectionDescriptor GetServer() { ConnectionDescriptor connection = _lastConnection; if (connection != null) { return connection; } connection = new ConnectionDescriptor(PickNewServer(_lastUnavailableServer, GetAvailableServers().ToList())) { KeepAlive = true }; _lastServer = connection.Server; _lastConnection = connection; return connection; }
public ConnectionDescriptor GetServer() { ConnectionDescriptor connection = _lastConnection; if (connection != null) { return(connection); } connection = new ConnectionDescriptor(PickNewServer(_lastUnavailableServer, GetAvailableServers().ToList())) { KeepAlive = true }; _lastServer = connection.Server; _lastConnection = connection; return(connection); }