示例#1
0
        public void ParseAsync(ZPacket[] packets)
        {
            lock (_threadInstanceLock)
            {
                if (_thread == null || !_thread.IsAlive)
                {
                    _thread = new Thread(new ThreadStart(_parseLoop))
                    {
                        IsBackground = true, Name = __threadName
                    };
                    _thread.Start();

                    _logger.Debug("Created a thread for parsing the server list");
                }
            }

            lock (_sync)
            {
                _cache.Enqueue(packets);

                _logger.Debug($"Incoming packets count: {packets.Length}");
            }
        }