Exemplo n.º 1
0
 public Server GetAServer(IStrategyCallerType type, IPEndPoint localIPEndPoint)
 {
     if (_currentServer == null)
     {
         ChooseNewServer(_controller.GetCurrentConfiguration().configs);
     }
     return(_currentServer);  //current server cached for CachedInterval
 }
 public Server GetAServer(IStrategyCallerType type, IPEndPoint localIPEndPoint, EndPoint destEndPoint)
 {
     if (_currentServer == null)
     {
         ChooseNewServer(_controller.GetCurrentConfiguration().configs);
     }
     return _currentServer;  //current server cached for CachedInterval
 }
 public Server GetAServer(IStrategyCallerType type, System.Net.IPEndPoint localIPEndPoint, EndPoint destEndPoint)
 {
     if (type == IStrategyCallerType.TCP)
     {
         ChooseNewServer();
     }
     if (_currentServer == null)
     {
         return(null);
     }
     return(_currentServer.server);
 }
Exemplo n.º 4
0
 public Server GetAServer(IStrategyCallerType type, IPEndPoint localIPEndPoint)
 {
     if (type == IStrategyCallerType.TCP)
     {
         ChooseNewServer();
     }
     if (_currentStatus == null)
     {
         return(null);
     }
     return(_currentStatus.ThisServer);
 }
 public Server GetAServer(IStrategyCallerType type, System.Net.IPEndPoint localIPEndPoint)
 {
     if (type == IStrategyCallerType.TCP)
     {
         ChooseNewServer();
     }
     if (_currentServer == null)
     {
         return null;
     }
     return _currentServer.server;
 }
 public Server GetAServer(IStrategyCallerType type, IPEndPoint localIPEndPoint)
 {
     IStrategy strategy = GetCurrentStrategy();
     if (strategy != null)
     {
         return strategy.GetAServer(type, localIPEndPoint);
     }
     if (_config.index < 0)
     {
         _config.index = 0;
     }
     return GetCurrentServer();
 }
        public Server GetAServer(IStrategyCallerType type, IPEndPoint localIPEndPoint, EndPoint destEndPoint)
        {
            IStrategy strategy = GetCurrentStrategy();

            if (strategy != null)
            {
                return(strategy.GetAServer(type, localIPEndPoint, destEndPoint));
            }
            if (_config.index < 0)
            {
                _config.index = 0;
            }
            return(GetCurrentServer());
        }
 public Server GetAServer(IStrategyCallerType type, IPEndPoint localIPEndPoint)
 {
     var configs = _controller.GetCurrentConfiguration().configs;
     int index;
     if (type == IStrategyCallerType.TCP)
     {
         index = _random.Next();
     }
     else
     {
         index = localIPEndPoint.GetHashCode();
     }
     return configs[index % configs.Count];
 }
Exemplo n.º 9
0
        public Server GetAServer(IStrategyCallerType type, IPEndPoint localIPEndPoint, EndPoint destEndPoint)
        {
            var configs = _controller.GetCurrentConfiguration().configs;
            int index;

            if (type == IStrategyCallerType.TCP)
            {
                index = _random.Next();
            }
            else
            {
                index = localIPEndPoint.GetHashCode();
            }
            return(configs[index % configs.Count]);
        }
 public SsServerInfo GetAServer(IStrategyCallerType type, System.Net.IPEndPoint localIPEndPoint)
 {
     if (type == IStrategyCallerType.TCP)
     {
         ChooseNewServer();
     }
     return _currentServer;
 }
        public SsServerInfo GetAServer(IStrategyCallerType type, IPEndPoint localIPEndPoint)
        {
            IStrategy strategy = GetCurrentStrategy();
            if (strategy != null)
            {
                return strategy.GetAServer(type, localIPEndPoint);
            }

            return GetCurrentServer();
        }
Exemplo n.º 12
0
 public Server GetAServer(IStrategyCallerType type, IPEndPoint localIPEndPoint)
 {
     throw new NotImplementedException();
 }