testsock.cpp

来自「简单的聊天工具,适合初学者,网络编程,VC++实现」· C++ 代码 · 共 59 行

CPP
59
字号
// TestSock.cpp : implementation file
//

#include "stdafx.h"
#include "testsocket2.h"
#include "TestSock.h"
#include "testsocket2Dlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// TestSock

TestSock::TestSock()
{
}

TestSock::~TestSock()
{
}


// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(TestSock, CSocket)
	//{{AFX_MSG_MAP(TestSock)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif	// 0

/////////////////////////////////////////////////////////////////////////////
// TestSock member functions
void TestSock::GetDlg(CTestsocket2Dlg *mdlg)
{
       dlg=mdlg;
}
void TestSock::OnAccept(int nErrorCode) 
{
    
    
	CSocket::OnAccept(nErrorCode);
}

void TestSock::OnReceive(int nErrorCode) 
{
  dlg->OnReceive();
  CSocket::OnReceive(nErrorCode);
}


void TestSock::OnClose(int nErrorCode) 
{
	dlg->OnClose();
	CSocket::OnClose(nErrorCode);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?