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

📄 tcpserverdlg.h

📁 winsock通讯
💻 H
字号:
// TCPServerDlg.h : header file
//

#if !defined(AFX_TCPSERVERDLG_H__A2B0F914_B1D5_4A8A_9680_6DAEE0C25008__INCLUDED_)
#define AFX_TCPSERVERDLG_H__A2B0F914_B1D5_4A8A_9680_6DAEE0C25008__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <afxtempl.h>
/////////////////////////////////////////////////////////////////////////////
// CTCPServerDlg dialog

class CTCPServerDlg : public CDialog
{
// Construction
public:
	void ReceiveData(UINT wParam,LONG lParam);
	CTCPServerDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CTCPServerDlg)
	enum { IDD = IDD_TCPSERVER_DIALOG };
	CButton	m_BtnCloseCtl;
	CButton	m_BtnSendctl;
	CEdit	m_sendMessageCtl;//发送消息
	CListBox	m_chatInfoCtl;//发送与接收全部消息
	CEdit	m_clientSendInfoCtl;//接受客户端发送消息
	CEdit	m_waitClientNoCtl;//等待处理客户数
	CEdit	m_clientNoCtl;//请求连接数
	CEdit	m_connectStateCtl;//连接状态
	int		m_clientNo;//请求连接数
	CString	m_serverName;//服务器名
	CString	m_connectState;//当前客户端连接状态
	int		m_waitClientNo;//等待处理客户数
	CString	m_sendMessage;//发送消息
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTCPServerDlg)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
    CArray <SOCKET,SOCKET&> MySock;//连接成功的套接字
	HICON m_hIcon;
	SOCKET m_serverConnectclient;//服务器端与客户端连接套接字
	SOCKET m_client;//负责接受客户端连接的套接字
	sockaddr_in serverAddr;
	SOCKET numSock;//负责发送数据的套接字
    BOOL m_CollectSvr;//判断是否连接上服务器
    BOOL m_setPortInfoBool;//是否设置好端口
	int m_Port1;//端口1
    CString m_setIp;//IP设置
	// Generated message map functions
	//{{AFX_MSG(CTCPServerDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	virtual void OnCancel();
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);//导出菜单项
	afx_msg void OnClose();//关闭服务器端
	afx_msg void OnReceive();//开始消息处理
	afx_msg void OnSetport();//设置端口
	afx_msg void OnBtnsend();//发送数据
	afx_msg void OnDblclkChatinfo();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_TCPSERVERDLG_H__A2B0F914_B1D5_4A8A_9680_6DAEE0C25008__INCLUDED_)

⌨️ 快捷键说明

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