📄 basesocket.h
字号:
/*
* General Information:
* TradeMark: TestDLL Dynamic Link Library
* ProductName:
*
* File Name: BaseSocket.h
* Author: cuizhongfa
* Project: test1
*
* Version: 1, 0, 0, 1
* Comments:
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Copyright Notice:
*
* Copyright (c) 2002 Shanghai BaoSight Co., Ltd.
*
* Warning: This computer program is protected by copyright law and
* international treaties. Unauthorized reproduction or distribution
* of this program, or any portion of it, may result in severe civil and
* criminal penalties, and will be prosecuted to the maximum extent
* possible under the law. *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Revision History:
*
* 10/31/2002 cuizhongfa Initial Version
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
// BaseSocket.h: interface for the CBaseSocket class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BASESOCKET_H__789B94C7_E49E_483D_8AD7_1112991AAFD2__INCLUDED_)
#define AFX_BASESOCKET_H__789B94C7_E49E_483D_8AD7_1112991AAFD2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <afxtempl.h>
#include <afxsock.h>
#include <afxpriv.h>
class CBaseSocket
{
public:
CBaseSocket();
virtual ~CBaseSocket();
public: //methods
BOOL Create();
BOOL Connect(LPCTSTR pszHostAddress, int nPort = 25);
BOOL Send(LPCTSTR pszBuf, int nBuf);
void Close();
int Receive(LPSTR pszBuf, int nBuf);
BOOL IsReadible(BOOL& bReadible);
protected:
BOOL Connect(const SOCKADDR* lpSockAddr, int nSockAddrLen);
SOCKET m_hSocket;
};
#endif // !defined(AFX_BASESOCKET_H__789B94C7_E49E_483D_8AD7_1112991AAFD2__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -