예제 #1
0
 /// <summary>
 /// 线程初始化
 /// </summary>
 public MessageThread(IMessageSessionManager sessionManager, SessionTriggerMode mode = SessionTriggerMode.Event)
 {
     _requestList = new LinkedList <MessageRequest>();
     //使用事件驱动
     _mode                = mode;
     _manager             = sessionManager;
     _thread              = new Thread(new ThreadStart(MessageThreadStart));
     _thread.IsBackground = false;
     _thread.Start();
 }
예제 #2
0
        /// <summary>
        /// 线程初始化
        /// </summary>
        public CometThread(IChatSessionManager sessionManager)
        {
            CometRequestList = new LinkedList<ICometRequest>();
            //使用事件驱动
            SessionRaisedMode = SessionTriggerMode.EventTrigger;
            CometChatMessage = new List<ChatMessageModel>();

            SessionManager = sessionManager;
            ChatThread = new Thread(new ThreadStart(CometThreadStart));
            ChatThread.IsBackground = false;
            ChatThread.Start();
        }