/// <summary> /// 初始化 /// </summary> /// <param name="asyncSocketServer"></param> /// <param name="socketUserToken"></param> public SocketInvokeElement(AsyncSocketServer asyncSocketServer, SocketUserToken socketUserToken) { m_asyncSocketServer = asyncSocketServer; m_socketUserToken = socketUserToken; m_outDataParser = new AssemblyOutDataParser(); m_InDataParser = new AssemblyInDataParser(); m_sendAsync = false; m_connectDT = DateTime.UtcNow; m_activeDT = DateTime.UtcNow; }
/// <summary> /// 初始化 /// </summary> /// <param name="asyncSocketServer"></param> /// <param name="socketUserToken"></param> public SocketInvokeElement(AsyncSocketServer asyncSocketServer, SocketUserToken socketUserToken) { m_asyncSocketServer = asyncSocketServer; m_socketUserToken = socketUserToken; m_outDataParser = new AssemblyOutDataParser(); m_InDataParser = new AssemblyInDataParser(); m_sendAsync = false; m_connectDT = DateTime.UtcNow; m_activeDT = DateTime.UtcNow; //InitMySql(); //m_saveDataThread = new Thread(saveDataFun); //m_saveDataThread.Start(); m_saveDataFileThread = new Thread(saveDataToFileFun); //利用构造函数,实例化一个线程,并且运行saveDataToFileFun函数 m_saveDataFileThread.Start(); //开启线程 }