📄 connects.h
字号:
// ConnectS.h : header file
//
// Microsoft Technical Support, Developer Support
// Copyright (c) 1998 Microsoft Corporation. All rights reserved.
#if !defined(AFX_CONNECTS_H__B7C54BD3_A555_11D0_8996_00AA00B92B2E__INCLUDED_)
#define AFX_CONNECTS_H__B7C54BD3_A555_11D0_8996_00AA00B92B2E__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "OpenSSLConnector.h"
#define MAX_BUFF 4096
/////////////////////////////////////////////////////////////////////////////
// CConnectSoc command target
class CMailbox;
class CConnectSoc : public CAsyncSocket, public CAsyncConnector::IConnectorCallback
{
// Attributes
public:
// Operations
public:
CConnectSoc();
virtual ~CConnectSoc();
void SetMailbox(CMailbox*p) {m_pBox = p;};
void CreateConnector(SSL_CTX *pContext);
int WriteString(LPCTSTR szData, int nLen);
int GetData(LPTSTR pBuf, int nSize); // return data from aReadBuf
public:
TCHAR m_sendBuff[MAX_BUFF+4];
int m_nSendDataLen; // length of data to send
int m_nBytesSent; // bytes sent so far
BOOL m_fConnected; // tcp connection
BOOL m_bReadDataLength; // reading packet header
void AsyncSendBuff(void* lpBuf, int nBufLen);
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CConnectSoc)
public:
virtual void OnClose(int nErrorCode);
virtual void OnReceive(int nErrorCode);
virtual void OnSend(int nErrorCode);
virtual int Receive(void* lpBuf, int nBufLen, int nFlags = 0);
virtual int Send(const void* lpBuf, int nBufLen, int nFlags = 0);
virtual void OnConnect( int nErrorCode );
//}}AFX_VIRTUAL
// Generated message map functions
//{{AFX_MSG(CConnectSoc)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
// Implementation
protected:
void DoAsyncSendBuff();
private :
CByteArray m_aReadBuf;
CMailbox* m_pBox;
virtual void WriteData(BYTE *pData, int dataLength);
virtual void OnDataAvailable();
CAsyncConnector *m_pConnector;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CONNECTS_H__B7C54BD3_A555_11D0_8996_00AA00B92B2E__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -