13 |
{ |
{ |
14 |
typedef std::list<TcpClientClass*>::iterator ClientIt; |
typedef std::list<TcpClientClass*>::iterator ClientIt; |
15 |
|
|
16 |
|
CString clientStr; |
17 |
|
CString host; |
18 |
|
unsigned int port; |
19 |
|
|
20 |
TcpClientClass* client = new TcpClientClass; |
TcpClientClass* client = new TcpClientClass; |
21 |
Accept(*client); |
Accept(*client); |
22 |
CSocket::OnAccept(nErrorCode); |
CSocket::OnAccept(nErrorCode); |
23 |
|
|
24 |
mClients.push_back(client); |
mClients.push_back(client); |
25 |
|
|
26 |
|
|
27 |
|
client->GetPeerName(host,port); |
28 |
|
clientStr.Format("Connection from %s:%d\n", host,port); |
29 |
|
OutputDebugString(clientStr); |
30 |
|
|
31 |
for (ClientIt it = mClients.begin(); it != mClients.end(); it++) |
for (ClientIt it = mClients.begin(); it != mClients.end(); it++) |
32 |
{ |
{ |
33 |
if ( (*it)->isClosed ) |
if ( (*it)->isClosed ) |