?? socketclient.h
字號(hào):
#if !defined(AFX_SOCKETCLIENT_H__F25829F8_EFFB_4D11_9D58_889B45139518__INCLUDED_)
#define AFX_SOCKETCLIENT_H__F25829F8_EFFB_4D11_9D58_889B45139518__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SocketClient.h : header file
//
//
// 注意:
// 在 InitInstance() 函數(shù)中調(diào)用 AfxSocketInit();函數(shù)來(lái)初始化網(wǎng)絡(luò)接口,在
// ExitInstance() 函數(shù)中調(diào)用 WSACleanup (); 關(guān)閉網(wǎng)絡(luò)接口
//
/////////////////////////////////////////////////////////////////////////////
// CSocketClient command target
#include <afxsock.h>
#include "PublicFunction.h"
#define NET_BUFFER_SIZE 4096 // 默認(rèn)緩沖大小
class CSocketClient : public CSocket
{
// Attributes
public:
BOOL Is_Connected() { return m_bConnected; }
// Operations
public:
CSocketClient ();
virtual ~CSocketClient();
CString GetDigitStrAtHead ( LPCTSTR lpszStr );
int GetResponse ( CString *pcsResponseStr=NULL, BOOL bBlock=TRUE );
BOOL GetResponse ( int nVerifyCode, CString *pcsResponseStr=NULL );
// Overrides
public:
void Disconnect();
int Receive ( char *szBuf, int size, BOOL bBlock=TRUE );
BOOL GetIPAndPortByPasvString ( LPCTSTR lpszPasvString, OUT CString &csIP, OUT USHORT &nPort );
void SetEventOfEndModule ( HANDLE hEvtEndModule );
BOOL Send ( char *data, int size );
BOOL SendString ( LPCTSTR lpszData, ... );
BOOL Connect ( LPCTSTR lpszHost, USHORT nPort );
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSocketClient)
//}}AFX_VIRTUAL
// Generated message map functions
//{{AFX_MSG(CSocketClient)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
// Implementation
protected:
private:
CString m_csResponseHistoryString;
HANDLE m_hEvtEndModule;
BOOL m_bConnected;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SOCKETCLIENT_H__F25829F8_EFFB_4D11_9D58_889B45139518__INCLUDED_)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -