?? net_logintcp.cpp
字號:
#include "stdafx.h"
#include "net_logintcp.h"
#include "net_cmdtcp.h"
extern bool is_cmd_data(byte* buf);
net_logintcp::net_logintcp()
{
}
net_logintcp::~net_logintcp()
{
destroy();
}
bool net_logintcp::create(ULONG ip, USHORT port, USHORT bindport)
{
if(!net_clienttcp::create(ip, port, bindport,FALSE))
{
destroy();
return false;
}
return true;
}
void net_logintcp::destroy()
{
net_clienttcp::destroy();
}
void net_logintcp::on_disconnect(ULONG from_ip, USHORT from_port)
{
net_cmdtcp *p = net_cmdtcp::m_netcmdp;
if(p)
p->on_disconnect(from_ip, from_port);
}
bool net_logintcp::on_net_tcp_recv(byte* buf, int length, ULONG from_ip, USHORT from_port)
{
if(is_cmd_data(buf))
{
net_cmdtcp *p = net_cmdtcp::m_netcmdp;
if(p)
p->on_net_tcp_recv(buf, length, from_ip, from_port, 0);
}
return true;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -