1 // CasServer.h: CCasServer クラスのインターフェイス
3 //////////////////////////////////////////////////////////////////////
10 #include "TsUtilClass.h"
11 #include "SmartSock.h"
17 class CCasServer : protected CCasClient::ICasClientHandler
20 class ICasServerHandler
23 virtual void OnCasServerEvent(CCasServer *pCasServer, const WORD wEventID) = 0;
28 CSEI_CONNECTED, // クライアント接続
29 CSEI_DISCONNECTED, // クライアント切断
33 CCasServer(ICasServerHandler *pEventHandler);
36 const BOOL OpenServer(const WORD wServerPort);
37 void CloseServer(void);
39 const DWORD GetClientNum(void) const;
42 virtual void OnCasClientEvent(CCasClient *pClient, const DWORD dwEventID, PVOID pParam);
44 void ServerThread(void);
45 static void* ServerThreadRaw(LPVOID pParam);
47 ICasServerHandler *m_pEventHandler;
50 pthread_t m_hServerThread;
52 typedef map<CCasClient *, CCasClient *> ClientList;
53 ClientList m_ClientList;