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

            _connection = new ConnectionDescriptor(url) { KeepAlive = true };
        }
        public SingleServerProvider(Uri url)
        {
            if (url == null)
            {
                throw new ArgumentNullException(nameof(url));
            }

            _connection = new ConnectionDescriptor(url)
            {
                KeepAlive = true
            };
        }
Esempio 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;
        }
Esempio 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);
        }