31 lines
864 B
C
31 lines
864 B
C
|
#ifndef __SOCKIOUSER_H__
|
|||
|
#define __SOCKIOUSER_H__
|
|||
|
|
|||
|
#include "WebMsg.h"
|
|||
|
#include "WebUser.h"
|
|||
|
|
|||
|
class SockIoUser : public WebUser
|
|||
|
{
|
|||
|
public:
|
|||
|
#if defined(HG_CMP_MSC)
|
|||
|
SockIoUser(class WebServer* server, HGUInt id, const char* ip, uint16_t port, SOCKET sockConn);
|
|||
|
#else
|
|||
|
SockIoUser(class WebServer* server, HGUInt id, const char* ip, uint16_t port, int sockConn);
|
|||
|
#endif
|
|||
|
virtual ~SockIoUser();
|
|||
|
|
|||
|
void HandleCmd(const SockIoCmdParam* param);
|
|||
|
void HandleRet(const SockIoRetParam* param);
|
|||
|
|
|||
|
protected:
|
|||
|
virtual void ThreadFunc();
|
|||
|
|
|||
|
private:
|
|||
|
static void ScanCallback(HGUInt event, void* value1, void *value2, void* param);
|
|||
|
static void GetMsgInfo(const SockIoCmdParam* param, std::string &user, std::string& data);
|
|||
|
bool ShakeHand(const std::string& head);
|
|||
|
void Pong();
|
|||
|
bool SendResponse(const HGByte* data, HGUInt size, HGBool text);
|
|||
|
};
|
|||
|
|
|||
|
#endif /* __SOCKIOUSER_H__ */
|