home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / advanced / chatsrvr / lstnsock.cpp < prev    next >
C/C++ Source or Header  |  1998-03-26  |  1KB  |  51 lines

  1. // lstnsock.cpp : implementation of the CListeningSocket class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "lstnsock.h"
  15. #include "srvrdoc.h"
  16.  
  17. CListeningSocket::CListeningSocket(CServerDoc* pDoc)
  18. {
  19.     m_pDoc = pDoc;
  20. }
  21.  
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CListeningSocket Overridable callbacks
  24.  
  25. void CListeningSocket::OnAccept(int nErrorCode)
  26. {
  27.     CSocket::OnAccept(nErrorCode);
  28.     m_pDoc->ProcessPendingAccept();
  29. }
  30.  
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CSocket Implementation
  33.  
  34. CListeningSocket::~CListeningSocket()
  35. {
  36. }
  37.  
  38. #ifdef _DEBUG
  39. void CListeningSocket::AssertValid() const
  40. {
  41.     CSocket::AssertValid();
  42. }
  43.  
  44. void CListeningSocket::Dump(CDumpContext& dc) const
  45. {
  46.     CSocket::Dump(dc);
  47. }
  48. #endif //_DEBUG
  49.  
  50. IMPLEMENT_DYNAMIC(CListeningSocket, CSocket)
  51.