/// <summary> /// 信息添加 /// </summary> /// <param name="msg"></param> void ServerShowStateInfo(LogInfo log) { if ((mesServer != null && mesServer.State != ServerState.Running) || LoadFinish == false || MainTabIndex != 1) { queueServer.ClearItems(); return; } queueServer.EnqueueItem(log); }
private void btnQueneServer_Click(object sender, EventArgs e) { QueueServer <PreDataInfo> queueServer = new QueueServer <PreDataInfo>(); queueServer.IsBackground = true; queueServer.ProcessItem += new Action <PreDataInfo>(queueServer_ProcessItem); //循环入队 for (int i = 0; i < 100; i++) { queueServer.EnqueueItem(new PreDataInfo(i.ToString(), DateTimeHelper.GetServerDateTime2().ToString())); Thread.Sleep(10); } }
void SessionClosed(MesSession session, global::SuperSocket.SocketBase.CloseReason value) { sessionClosedQueueServer.EnqueueItem(session); }