/* ==================================================================== * ÆÄ ÀÏ : Sender.h * ¸ñ Àû : * ÀÛ ¼º ÀÚ : °ûöÁß * ÀÛ ¼º ÀÏ : 07/02/13 * ÁÖÀÇ»çÇ× : * =================================================================== */ #ifndef __LOG_SENDER_H__ #define __LOG_SENDER_H__ //#ifndef WINVER //#define WINVER 0x0500 //#endif // //#ifndef _WIN32_WINNT //#define _WIN32_WINNT 0x0500 //#endif #pragma once #include "iocpudpsend.h" #include "logprotocol.h" #include "serverprotocol.h" #include "servermanager.h" class cSender : public cIocpUdpSend { private: SOCKADDR_IN mGame; u_short mGameSeq; IoContextBuffer* mGameBuffer; DWORD mGameRelay; SOCKADDR_IN mLog; u_short mLogSeq; IoContextBuffer* mLogBuffer; DWORD mLogRelay; SOCKADDR_IN mRecv; public: // Log °ü·Ã ¸Þ¼Òµå. bool PostServerEvent ( char* message ); bool PostMemberEvent ( char type, char category, long memberIdx, char* message ); bool PostConcurrentEvent ( long serverIdx, long minimum, long maximum, char* message ); public: // Game °ü·Ã ¸Þ¼Òµå. bool PostChSync ( ); bool PostChList ( ServerTable* root ); bool PostChStatus ( long cid, BYTE status ); private: bool SendComplete ( ULONG_PTR completionKey, PerIoContext* perIoContext, DWORD bytesTransferred ); public: // Ŭ·¡½º »ý¼º ¹× °ø¿ë ¸Þ¼Òµå. cSender(void); bool Initialize ( char* send, char* recv, u_short numWorkerThreads=2, unsigned int bufferLength=65535 ); void Shutdown ( DWORD maxWait=INFINITE ); bool ReSendPost ( u_long addr, u_short port, u_long seq ); bool SendReliable ( u_long addr, u_short port, u_long seq ); char* GetPacket ( void** handle, char tos, SOCKADDR_IN addr, u_short& seq ); bool SendPacket ( void* handle, unsigned long length=0 ); void GetRegisterDate ( TIMESTAMP_STRUCT* ts ); DWORD BackendThread ( ); public: // Ŭ·¡½º ÆÄ±« ¸Þ¼Òµå. virtual ~cSender(void); }; #endif // __LOG_SENDER_H__