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

📄 udp.h

📁 UDP套接字编程 很好的程序 大家运行一下
💻 H
字号:
#if !defined(AFX_UDP_H__DD70BE48_5F9E_401E_B2E8_6BEC761E9A69__INCLUDED_)
#define AFX_UDP_H__DD70BE48_5F9E_401E_B2E8_6BEC761E9A69__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// UDP.h : header file
//



/////////////////////////////////////////////////////////////////////////////
// CUDP command target
typedef struct tagUDPPackage
{
	char ip[32];
	unsigned int port;
	int len;
	unsigned char *pData;
} UDPPackage;
#define MAX_BUFFER_NUM 2
class CUDP : public CAsyncSocket
{
// Attributes
public:

// Operations
public:
	CUDP(CWnd* pWnd=NULL,UINT UserMessageID=WM_USER+1,int MaxPackageSize=16384);
	virtual ~CUDP();

// Overrides
public:
	CString GetHostIP();
	CRITICAL_SECTION UDPCriticalSection;
	int m_Index;
	UDPPackage m_Udp_Buffer[MAX_BUFFER_NUM];
	int m_MaxPackageSize;
	UINT m_UserMessageID;
	CWnd* m_pWnd;

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CUDP)
	public:
	virtual void OnReceive(int nErrorCode);
	virtual void OnSend(int nErrorCode);
	//}}AFX_VIRTUAL

	// Generated message map functions
	//{{AFX_MSG(CUDP)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

// Implementation
protected:
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_UDP_H__DD70BE48_5F9E_401E_B2E8_6BEC761E9A69__INCLUDED_)

⌨️ 快捷键说明

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