Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
SocketClient.h
Package: NetDownMTR.rar [view]
Upload User: oadesign
Upload Date: 2013-12-25
Package Size: 265k
Code Size: 2k
Category:
Process-Thread
Development Platform:
Visual C++
- #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() 函数中调用 AfxSocketInit();函数来初始化网络接口,在
- // ExitInstance() 函数中调用 WSACleanup (); 关闭网络接口
- //
- /////////////////////////////////////////////////////////////////////////////
- // CSocketClient command target
- #include <afxsock.h>
- #include "PublicFunction.h"
- #define NET_BUFFER_SIZE 4096 // 默认缓冲大小
- 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_)