ConnectThread.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // ConnectThread.h : header file
  2. #if !defined(AFX_CONNECTT_H__B7C54BD2_A555_11D0_8996_00AA00B92B2E__INCLUDED_)
  3. #define AFX_CONNECTT_H__B7C54BD2_A555_11D0_8996_00AA00B92B2E__INCLUDED_
  4. #include "ConnectSocket.h" // Added by ClassView
  5. #if _MSC_VER >= 1000
  6. #pragma once
  7. #endif // _MSC_VER >= 1000
  8. class CConnectThread : public CWinThread
  9. {
  10. DECLARE_DYNCREATE(CConnectThread)
  11. protected:
  12. CConnectThread(); // protected constructor used by dynamic creation
  13. // Attributes
  14. public:
  15. void IncReceivedBytes(int nBytes);
  16. void IncSentBytes(int nBytes);
  17. static VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT uIDEvent, DWORD dwTime);
  18. // Operations
  19. public:
  20. void UpdateStatistic(int nType);
  21. CString m_strRemoteHost;
  22. CTime m_LastDataTransferTime;
  23. // Used to pass the socket handle from the main thread to this thread.
  24. SOCKET m_hSocket;
  25. CConnectSocket m_ConnectSocket;
  26. public:
  27. virtual BOOL InitInstance();
  28. virtual int ExitInstance();
  29. //}}AFX_VIRTUAL
  30. // Implementation
  31. protected:
  32. UINT m_nTimerID;
  33. virtual ~CConnectThread();
  34. int m_nReceivedBytes;
  35. int m_nSentBytes;
  36. //}}AFX_MSG
  37. //LRESULT OnThreadMessage(WPARAM wParam, LPARAM lParam);
  38. void OnThreadMessage(WPARAM wParam, LPARAM lParam);
  39. DECLARE_MESSAGE_MAP()
  40. };
  41. /////////////////////////////////////////////////////////////////////////////
  42. //{{AFX_INSERT_LOCATION}}
  43. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  44. #endif // !defined(AFX_CONNECTT_H__B7C54BD2_A555_11D0_8996_00AA00B92B2E__INCLUDED_)