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

📄 net_clienttcp.h

📁 实时监控
💻 H
字号:
#ifndef _NET_CLIENTTCP_H
#define	_NET_CLIENTTCP_H

#include "thread.h"
#include "net_addr.h"


class net_clienttcp: public thread_base
{
	ULONG   _ip;

	USHORT  _port;

	byte getdatabuf[32768];
	
	int bind_port;
	
	
	void entry();

	bool bind_socket();

	bool got_something();

	
protected:
	virtual void on_disconnect(ULONG from_ip, USHORT from_port){};

	virtual bool on_net_tcp_recv(byte* buf, int length, ULONG from_ip, USHORT from_port){ return true;};
	
public:
	SOCKET connect_socket;
	BOOL create_udp_socket(ULONG ip,USHORT port);
	
	net_clienttcp();
	
	virtual ~net_clienttcp();

	bool create(ULONG connectip, USHORT connectport, USHORT bindport,BOOL bUdpav);

	bool connect_server(ULONG ip, USHORT port);

	void send_something(char * buf, int length);

	ULONG  get_clientip()	{return _ip;}

	USHORT get_clientport()	{return _port;}

	void clossock();

	void release_port();

	BOOL join(ULONG ip,USHORT port);

	void shutdownsocket();

	virtual void destroy();
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -