private static void ProcQueue(Object oIndex) { Int32 index = (Int32)oIndex; LoadTestDatabase db = new LoadTestDatabase(env.ConnectionString); while (true) { try { TrapQueueItem queueItem = null; while ((queueItem = _queue.nextItem) != null) { SNMPTrap trap = new SNMPTrap(queueItem.receivedDate, queueItem.receivedEP, queueItem.packet); db.insertMessages(env.TestName, "8. SNMP Trap from " + trap.receivedEP.Address.ToString(), trap.ToString()); #if DEBUG Console.WriteLine(trap.ToString()); #else Console.Write("."); #endif } } catch { } Thread.Sleep(300); } }
public void Add(TrapQueueItem log) { lock (_logItems) { _logItems.Add(log); } }