Ejemplo n.º 1
0
 public TCPRelay(ShadowSocksController controller, Configuration conf)
 {
     _controller    = controller;
     _config        = conf;
     Handlers       = new HashSet <TCPHandler>();
     _lastSweepTime = DateTime.Now;
 }
Ejemplo n.º 2
0
 public static ShadowSocksController instance()
 {
     if (_shadowsocksController == null)
     {
         _shadowsocksController = new ShadowSocksController();
     }
     return(_shadowsocksController);
 }
Ejemplo n.º 3
0
        public TCPHandler(ShadowSocksController controller, Configuration config, TCPRelay tcprelay, Socket socket)
        {
            _controller    = controller;
            _config        = config;
            _tcprelay      = tcprelay;
            _connection    = socket;
            _proxyTimeout  = config.proxy.proxyTimeout * 1000;
            _serverTimeout = config.GetCurrentServer().timeout * 1000;

            lastActivity = DateTime.Now;
        }
Ejemplo n.º 4
0
 internal void UpdateConfiguration(ShadowSocksController controller)
 {
     _controller = controller;
     Reset();
     try
     {
         if (Config.StatisticsEnabled)
         {
             StartTimerWithoutState(ref _recorder, Run, RecordingInterval);
             LoadRawStatistics();
             StartTimerWithoutState(ref _speedMonior, UpdateSpeed, _monitorInterval);
         }
         else
         {
             _recorder?.Dispose();
             _speedMonior?.Dispose();
         }
     }
     catch (Exception e)
     {
         Logging.LogUsefulException(e);
     }
 }
Ejemplo n.º 5
0
 public UDPRelay(ShadowSocksController controller)
 {
     this._controller = controller;
 }