📄 cnserverclient.h
字号:
//---------------------------------------------------------------------------
class CNServerClient;
typedef short CNServerClientId;
#ifndef CNServerClientH
#define CNServerClientH
//---------------------------------------------------------------------------
#include <list.h>
#include "CommandTable.h"
#include "CNServer.h"
typedef std::list<CNServerClientId> CNServerClientList;
class CNServerClient
{
public:
// Constructor/destructor
CNServerClient();
~CNServerClient();
// Allow the client thread to see inside the client object
friend class CNServerClientThread;
// Init
virtual BOOL Init(CNServer *server,
VSocket *socket,
CNServerClientId newid);
virtual CNServerClientId GetClientId() {return m_id;};
protected:
CNServerClientId m_id;
CNServer *m_server;
// The socket
VSocket *m_socket;
char *m_client_name;
// The client thread
omni_thread *m_thread;
};
class CNServerClientThread : public omni_thread
{
public:
// Init
virtual BOOL Init(CNServerClient *client,
CNServer *server,
VSocket *socket);
virtual VInt32 AnalyzeParams(VString Buff,WORD BuffLen); //分析参数串
// The main thread function
virtual void run(void *arg); //主循环
protected:
virtual ~CNServerClientThread();
// Fields
protected:
char ParamBuf[MAX_PARAM_COUNT][MAX_PARAM_LENGTH +1];
VSocket *m_socket;
CNServer *m_server;
CNServerClient *m_client;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -