⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 net_logintcp.cpp

📁 实时监控
💻 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 + -