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 / clntsock.h < prev    next >
C/C++ Source or Header  |  1998-03-26  |  1KB  |  61 lines

  1. // clntsock.h : interface of the CClientSocket 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. #ifndef __CLNTSOCK_H__
  14. #define __CLNTSOCK_H__
  15.  
  16. class CMsg;
  17. class CServerDoc;
  18.  
  19. class CClientSocket : public CSocket
  20. {
  21.     DECLARE_DYNAMIC(CClientSocket);
  22. private:
  23.     CClientSocket(const CClientSocket& rSrc);         // no implementation
  24.     void operator=(const CClientSocket& rSrc);  // no implementation
  25.  
  26. // Construction
  27. public:
  28.     CClientSocket(CServerDoc* m_pDoc);
  29.  
  30. // Attributes
  31. public:
  32.     int m_nMsgCount;
  33.     CSocketFile* m_pFile;
  34.     CArchive* m_pArchiveIn;
  35.     CArchive* m_pArchiveOut;
  36.     CServerDoc* m_pDoc;
  37.     BOOL IsAborted() { return m_pArchiveOut == NULL; }
  38.  
  39. // Operations
  40. public:
  41.     void Init();
  42.     void Abort();
  43.     void SendMsg(CMsg* pMsg);
  44.     void ReceiveMsg(CMsg* pMsg);
  45.  
  46. // Overridable callbacks
  47. protected:
  48.     virtual void OnReceive(int nErrorCode);
  49.  
  50. // Implementation
  51. public:
  52.     virtual ~CClientSocket();
  53.  
  54. #ifdef _DEBUG
  55.     virtual void AssertValid() const;
  56.     virtual void Dump(CDumpContext& dc) const;
  57. #endif
  58. };
  59.  
  60. #endif // __CLNTSOCK_H__
  61.