📄 queue.cpp
字号:
// Queue.cpp : implementation file
//
#include "stdafx.h"
#include "Server.h"
#include "Queue.h"
#include"ServerDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CQueue
CQueue::CQueue()
{
}
CQueue::~CQueue()
{
}
// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CQueue, CSocket)
//{{AFX_MSG_MAP(CQueue)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif // 0
/////////////////////////////////////////////////////////////////////////////
// CQueue member functions
void CQueue::OnAccept(int nErrorCode)
{
CClientSocket*pSocket=new CClientSocket();
CServerDlg*pWnd=((CServerDlg*)(AfxGetApp()->m_pMainWnd));
if(pWnd->m_pSocket->Accept(*pSocket))
{
pWnd->m_SocketList.AddTail(pSocket);
pWnd->MessageBox("Listen a connect");
}
else delete pSocket;
CSocket::OnAccept(nErrorCode);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -