?? 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__;
#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;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -