/[H7]/trunk/H7 Server/TcpServerClass.cpp
ViewVC logotype

Diff of /trunk/H7 Server/TcpServerClass.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 35 by hedin, Wed Jan 31 17:22:59 2007 UTC revision 36 by hedin, Thu Feb 1 09:21:43 2007 UTC
# Line 13  void TcpServerClass::OnAccept(int nError Line 13  void TcpServerClass::OnAccept(int nError
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 )

Legend:
Removed from v.35  
changed lines
  Added in v.36

  ViewVC Help
Powered by ViewVC 1.1.20