X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=b25-remote%2FCasServer.h;h=3757d68507a077a6bf591eafd8cc6ea48f3b449a;hb=3534e118918876b64882f2912c8e6c1b37158b84;hp=35d77329c24e3bcfe8f10adfaa2090773d03793f;hpb=7868a1563cc62577db56b634e7505107559dbc62;p=rec10%2Frec10-git.git diff --git a/b25-remote/CasServer.h b/b25-remote/CasServer.h index 35d7732..3757d68 100755 --- a/b25-remote/CasServer.h +++ b/b25-remote/CasServer.h @@ -1,56 +1,56 @@ -// CasServer.h: CCasServer ƒNƒ‰ƒX‚̃Cƒ“ƒ^[ƒtƒFƒCƒX -// -////////////////////////////////////////////////////////////////////// - -#pragma once - - -#include -#include "CasClient.h" -#include "TsUtilClass.h" -#include "SmartSock.h" - - -using std::map; - - -class CCasServer : protected CCasClient::ICasClientHandler -{ -public: - class ICasServerHandler - { - public: - virtual void OnCasServerEvent(CCasServer *pCasServer, const WORD wEventID) = 0; - }; - - enum - { - CSEI_CONNECTED, // ƒNƒ‰ƒCƒAƒ“ƒgÚ‘± - CSEI_DISCONNECTED, // ƒNƒ‰ƒCƒAƒ“ƒgØ’f - }; - - CCasServer(void); - CCasServer(ICasServerHandler *pEventHandler); - ~CCasServer(void); - - const BOOL OpenServer(const WORD wServerPort); - void CloseServer(void); - - const DWORD GetClientNum(void) const; - -protected: - virtual void OnCasClientEvent(CCasClient *pClient, const DWORD dwEventID, PVOID pParam); - - void ServerThread(void); - static void* ServerThreadRaw(LPVOID pParam); - - ICasServerHandler *m_pEventHandler; - - CSmartSock m_pSocket; +// CasServer.h: CCasServer クラスのインターフェイス +// +////////////////////////////////////////////////////////////////////// + +#pragma once + + +#include +#include "CasClient.h" +#include "TsUtilClass.h" +#include "SmartSock.h" + + +using std::map; + + +class CCasServer : protected CCasClient::ICasClientHandler +{ +public: + class ICasServerHandler + { + public: + virtual void OnCasServerEvent(CCasServer *pCasServer, const WORD wEventID) = 0; + }; + + enum + { + CSEI_CONNECTED, // クライアント接続 + CSEI_DISCONNECTED, // クライアント切断 + }; + + CCasServer(void); + CCasServer(ICasServerHandler *pEventHandler); + ~CCasServer(void); + + const BOOL OpenServer(const WORD wServerPort); + void CloseServer(void); + + const DWORD GetClientNum(void) const; + +protected: + virtual void OnCasClientEvent(CCasClient *pClient, const DWORD dwEventID, PVOID pParam); + + void ServerThread(void); + static void* ServerThreadRaw(LPVOID pParam); + + ICasServerHandler *m_pEventHandler; + + CSmartSock m_pSocket; pthread_t m_hServerThread; - - typedef map ClientList; - ClientList m_ClientList; - - CCriticalLock m_Lock; -}; + + typedef map ClientList; + ClientList m_ClientList; + + CCriticalLock m_Lock; +};