12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- //mainCtrl.h
- ///////////////////////////////////////////////////////////////////////////////
- #ifndef _MAIN_CTRL_H_
- #define _MAIN_CTRL_H_
- ///////////////////////////////////////////////////////////////////////////////
- #include <stdio.h>
- #include <conio.h>
- #include <io.h>
- #include "ServerTunnel.h"
- #include "./include/TableInfoMgr.h"
- ///////////////////////////////////////////////////////////////////////////////
- /*/////////////////////////////////////////////////////////////////////////* /
- #if defined(__cplusplus)
- extern "C" {
- #endif
- /*/////////////////////////////////////////////////////////////////////////*/
- class CMainCtrl
- {
- public:
- CMainCtrl();
- ~CMainCtrl();
- public:
- int StartServer();
- int StopServer();
- void processNetEvent(IN SOCKET hSocket,
- IN ETransportEvent eEvent,
- IN void *pRecvMsg, IN unsigned long nDataLen);
- public:
- void WriteLog(CString account, CString content);
- BOOL IsExist(CString account,CString phones,CString content,CString timestamp);
-
- int GetCount(CString phones,CString content);
- CTableInfoMgr *GetClientConnectionTable();
- private:
- CServerTunnel m_tServerTunnel;
- CTableInfoMgr m_tClientConnections;
- private:
- void processLoginRequest(void *pLoginInfo);
- void processDiconnection(unsigned long ulUserID);
- void processChatMessageRequest(void *pChatMessage);
- private:
- int VerifyUserLoginInfo(void *pLoginInfo);
- void sendMessageToAllUsers(void *pHeader, void *pDataBuf, unsigned long ulDataLen);
-
- };
- /*/////////////////////////////////////////////////////////////////////////* /
- #if defined(__cplusplus)
- }
- #endif
- /*/////////////////////////////////////////////////////////////////////////*/
- #endif /*_MAIN_CTRL_H_*/
|