#pragma once
|
|
|
#include "akNetworkLinker.h"
|
#include <WinSock2.h>
|
|
#include "akThread.h"
|
#include <queue>
|
|
class AKNETWORK_DLLSPEC CakSharedClient : public CakThreadInterface
|
{
|
public:
|
typedef void (*SystemMsgFunc) (char* pMsg, int nMsglen, void*);
|
|
public:
|
CakSharedClient(void);
|
~CakSharedClient(void);
|
|
bool isConnect();
|
|
bool setServerName(char* pServerName);
|
|
// ½Ã½ºÅÛ ¸Þ¼¼Áö ¼ö½Å ÄÝ¹é ¼³Á¤
|
void SetSystemMessageCallback(SystemMsgFunc userFunc, void* data = NULL);
|
// ¸Þ¼¼Áö Àü¼Û
|
bool Send(char* pSend, int nLen, int nWaitTimeMS=0);
|
bool SendSafe(char* pSend, int nLen);
|
|
protected:
|
void setSystemMsg(const char* pMsg, ...);
|
|
SystemMsgFunc m_systemmsgFunc;
|
void* m_systemmsgData;
|
|
virtual void threadRun();
|
protected:
|
CakThread m_akThread;
|
|
HANDLE m_hSharedMap;
|
char* m_pSharedMemory;
|
|
HANDLE m_hEventSendMessage;
|
|
};
|