ConnectThread.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. void OnThreadMessage(WPARAM wParam, LPARAM lParam);
  38. DECLARE_MESSAGE_MAP()
  39. };
  40. /////////////////////////////////////////////////////////////////////////////
  41. //{{AFX_INSERT_LOCATION}}
  42. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  43. #endif // !defined(AFX_CONNECTT_H__B7C54BD2_A555_11D0_8996_00AA00B92B2E__INCLUDED_)