socketthread.cpp

来自「CMPP3.0模拟网关」· C++ 代码 · 共 51 行

CPP
51
字号
// SocketThread.cpp : implementation file
//

#include "stdafx.h"
#include "CmppGateway.h"
#include "SocketThread.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// SocketThread

IMPLEMENT_DYNCREATE(SocketThread, CWinThread)

SocketThread::SocketThread()
{
}

SocketThread::~SocketThread()
{
}

BOOL SocketThread::InitInstance()
{
	// TODO:  perform and per-thread initialization here
	CCmppGatewayDlg *pDlg = new CCmppGatewayDlg();
	BOOL bCreat = sockServer.Create(pDlg->m_nPort, SOCK_STREAM);
	bCreat = sockServer.Listen();
	delete pDlg;
	return TRUE;
}

int SocketThread::ExitInstance()
{
	// TODO:  perform any per-thread cleanup here
	return CWinThread::ExitInstance();
}

BEGIN_MESSAGE_MAP(SocketThread, CWinThread)
	//{{AFX_MSG_MAP(SocketThread)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// SocketThread message handlers

⌨️ 快捷键说明

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