ConnectThread.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. // Used to pass the socket handle from the main thread to this thread.
  23. SOCKET m_hSocket;
  24. // CSocket derived class that handles the connection.
  25. CConnectSocket m_ConnectSocket;
  26. // Overrides
  27. // ClassWizard generated virtual function overrides
  28. //{{AFX_VIRTUAL(CConnectThread)
  29. public:
  30. virtual BOOL InitInstance();
  31. virtual int ExitInstance();
  32. //}}AFX_VIRTUAL
  33. // Implementation
  34. protected:
  35. UINT m_nTimerID;
  36. virtual ~CConnectThread();
  37. int m_nReceivedBytes;
  38. int m_nSentBytes;
  39. CTime m_LastDataTransferTime;
  40. // Generated message map functions
  41. //{{AFX_MSG(CConnectThread)
  42. //}}AFX_MSG
  43. LRESULT OnThreadMessage(WPARAM wParam, LPARAM lParam);
  44. DECLARE_MESSAGE_MAP()
  45. };
  46. /////////////////////////////////////////////////////////////////////////////
  47. //{{AFX_INSERT_LOCATION}}
  48. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  49. #endif // !defined(AFX_CONNECTT_H__B7C54BD2_A555_11D0_8996_00AA00B92B2E__INCLUDED_)