www.pudn.com > chat-dialog.rar > ListenSocket.cpp


// ListenSocket.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "Sever1_2.h" 
#include "ListenSocket.h" 
//#include "Sever1_2Dlg.h" 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
 
///////////////////////////////////////////////////////////////////////////// 
// CListenSocket 
 
CListenSocket::CListenSocket() 
{ 
	m_nsockNum=0; 
	for (int ix=0;ix=m_ntotleNum) 
	{ 
		AfxMessageBox("the Sever is full!"); 
		return; 
	} 
 
 
	CSeverSocket* pSocket=new CSeverSocket; 
 
//	CSocket::Listen(2); 
	CSocket::Accept(*pSocket); 
	CSocket::OnAccept(nErrorCode); 
	m_sockerRev[m_nsockNum]=pSocket; 
	pSocket->m_pParentWnd=m_pParentWnd; 
	 
	m_nsockNum++; 
//	CString str; 
//	str=strReceive; 
//	pSocket->Send(str,str.GetLength()); 
}