Exemplo n.º 1
0
        public SingleServerProvider(Uri url)
        {
            if (url == null)
            {
                throw new ArgumentNullException(nameof(url));
            }

            _connection = new ConnectionDescriptor(url) { KeepAlive = true };
        }
Exemplo n.º 2
0
        public SingleServerProvider(Uri url)
        {
            if (url == null)
            {
                throw new ArgumentNullException(nameof(url));
            }

            _connection = new ConnectionDescriptor(url)
            {
                KeepAlive = true
            };
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        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);
        }