Пример #1
0
 public TCPRelay(PhotonController controller, Configuration conf)
 {
     _controller    = controller;
     _config        = conf;
     Handlers       = new HashSet <TCPHandler>();
     _lastSweepTime = DateTime.Now;
 }
Пример #2
0
        public TCPHandler(PhotonController 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;
        }
 internal void UpdateConfiguration(PhotonController 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);
     }
 }
Пример #4
0
 public UDPRelay(PhotonController controller)
 {
     this._controller = controller;
 }