/// <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(); }
/// <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(); }