【VC开源代码栏目提醒】:网学会员鉴于大家对VC开源代码十分关注,论文会员在此为大家搜集整理了“ClientSocketList.cpp”一文,供大家参考学习
// ClientSocketList.cpp: implementation of the CClientSocketList class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ChatRoomServer.h"
#include "ClientSocketList.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CClientSocketList::CClientSocketList()
{
Head=0;
}
CClientSocketList::~CClientSocketList()
{
}
BOOL CClientSocketList::Add(CClientSocket *add)
{
CClientSocket *tmp=Head;
if (!Head)
{
Head=add;
return true;
}
while (tmp->Next) tmp=tmp->Next;
tmp->Next=add;
return true;
}
BOOL CClientSocketList::Sends(CClientSocket *tmp)
{
char buff[1000];
int n;
CClientSocket *curr=Head;
n=tmp->Receive(buff,1000);
buff[n]=0;
while (curr)
{
curr->Send(buff,n);
curr=curr->Next;
}
return true;
}
上一篇:
ClientSocket.cpp
下一篇:
经典高三励志演讲稿