📄 netsocket.cpp
字号:
// NetSocket.cpp : implementation file
//
#include "stdafx.h"
#include "mainfrm.h"
#include "LaneSoft.h"
#include "NetSocket.h"
#include "NetComManger.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNetSocket
extern BOOL m_BClose;
CNetSocket::CNetSocket(CNetComManger * pManger)
{
m_pManger = pManger;
m_BClose = TRUE;
}
CNetSocket::~CNetSocket()
{
}
// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CNetSocket, CSocket)
//{{AFX_MSG_MAP(CNetSocket)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif // 0
/////////////////////////////////////////////////////////////////////////////
// CNetSocket member functions
void CNetSocket::OnReceive(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
m_pManger->FetchMsg(this);
CSocket::OnReceive(nErrorCode);
}
void CNetSocket::OnClose(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
// m_BClose = true;
m_pManger->OnConnectClose() ;
CSocket::OnClose(nErrorCode);
}
void CNetSocket::OnOutOfBandData(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
CSocket::OnOutOfBandData(nErrorCode);
}
BOOL CNetSocket::OnMessagePending()
{
// TODO: Add your specialized code here and/or call the base class
return CSocket::OnMessagePending();
}
void CNetSocket::OnConnect(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
CSocket::OnConnect(nErrorCode);
}
BOOL CNetSocket::IsClose()
{
return m_BClose;
}
void CNetSocket::HaveConnect()
{
m_BClose = false;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -