private void loopMsg() { while (this.session.Connected) { // if (msecond > 5 * 1000) { msecond = 1000; } //执行脚本; WebSocketIronPythonManager.ScriptExec(this, this.loopScripTxt); //等待10毫秒; Thread.Sleep(1000); msecond += 1000; } }
private void DealMsg(WebSocketSession session, string msg) { try { if (OnAddLogEvent != null) { OnAddLogEvent("连接", msg); } //MessageBox.Show(hashtable.Count.ToString()); MyWebSocketSession ReqSessoin = sessionList.Find(delegate(MyWebSocketSession temp) { return(temp.sessionid == session.SessionID); }); if (ReqSessoin != null) { ReqSessoin.LastMsg = msg; //执行脚本; WebSocketIronPythonManager.ScriptExec(ReqSessoin, this.pythonScriptTxt); } } catch (Exception ex) { } }