Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new UdpServer class.
 /// </summary>
 public UdpServer()
 {
     _packageListeners = new List<IPackageListener>();
     _connections = new List<IConnection>();
     _logger = LogManager.GetClassLogger();
     _connectionManager = new UdpConnectionManager();
     _connectionManager.PingTimedOut += _connectionManager_PingTimedOut;
     _connectionManager.Start();
     TimeOutLatency = 500f;
     _listener = new System.Net.Sockets.UdpClient(2563);
     IsActive = true;
     var beginHandle = new Thread(BeginAcceptConnections) {IsBackground = true};
     var pingHandle = new Thread(PingRequestLoop) {IsBackground = true};
     beginHandle.Start();
     pingHandle.Start();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new UdpServer class.
        /// </summary>
        public UdpServer()
        {
            _packageListeners  = new List <IPackageListener>();
            _connections       = new List <IConnection>();
            _logger            = LogManager.GetClassLogger();
            _connectionManager = new UdpConnectionManager();
            _connectionManager.PingTimedOut += _connectionManager_PingTimedOut;
            _connectionManager.Start();
            TimeOutLatency = 500f;
            _listener      = new System.Net.Sockets.UdpClient(2563);
            IsActive       = true;
            var beginHandle = new Thread(BeginAcceptConnections)
            {
                IsBackground = true
            };
            var pingHandle = new Thread(PingRequestLoop)
            {
                IsBackground = true
            };

            beginHandle.Start();
            pingHandle.Start();
        }