ConnectThread.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. CDatabase m_conndb;
  18. static VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT uIDEvent, DWORD dwTime);
  19. // Operations
  20. public:
  21. void UpdateStatistic(int nType);
  22. CString m_strRemoteHost;
  23. // Used to pass the socket handle from the main thread to this thread.
  24. SOCKET m_hSocket;
  25. // CSocket derived class that handles the connection.
  26. CConnectSocket m_ConnectSocket;
  27. // Overrides
  28. // ClassWizard generated virtual function overrides
  29. //{{AFX_VIRTUAL(CConnectThread)
  30. public:
  31. virtual BOOL InitInstance();
  32. virtual int ExitInstance();
  33. //}}AFX_VIRTUAL
  34. // Implementation
  35. protected:
  36. UINT m_nTimerID;
  37. virtual ~CConnectThread();
  38. int m_nReceivedBytes;
  39. int m_nSentBytes;
  40. CTime m_LastDataTransferTime;
  41. // Generated message map functions
  42. //{{AFX_MSG(CConnectThread)
  43. //}}AFX_MSG
  44. #ifdef VC60
  45. LRESULT OnThreadMessage(WPARAM wParam, LPARAM lParam);
  46. #else
  47. void OnThreadMessage(WPARAM wParam, LPARAM lParam);
  48. #endif
  49. DECLARE_MESSAGE_MAP()
  50. };
  51. /////////////////////////////////////////////////////////////////////////////
  52. //{{AFX_INSERT_LOCATION}}
  53. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  54. #endif // !defined(AFX_CONNECTT_H__B7C54BD2_A555_11D0_8996_00AA00B92B2E__INCLUDED_)