Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.6 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: LgNetSocket.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of LgNetSocket.h
  13. //----------------------------------------------------------------------------
  14. #ifndef __LG__NET__SOCKET__H__INCLUDED__
  15. #define __LG__NET__SOCKET__H__INCLUDED__
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #include "LgNetObject.h"
  20. #include "..\Thread.h"
  21. #include "..\Comm\Protocol.h"
  22. class CLgNetSocketDevice;
  23. class CLgNetSocket :
  24. public CLgNetObject,
  25. public CLgLinkP<CLgNetSocket,CLgNetSocketDevice>,
  26. private CLgThread
  27. {
  28. public:
  29. CLgNetSocket();
  30. virtual ~CLgNetSocket();
  31. public:
  32. BOOL Create( CProtocol *pProtocol );
  33. BOOL Pause( BOOL bPause );
  34. void Destroy();
  35. public:
  36. virtual BOOL SetBaudrate( DWORD nBaudrate ) { return FALSE; }
  37. public:
  38. virtual BOOL Link( CLgLink<CLgNetSocketDevice,CLgNetSocket>* );
  39. protected:
  40. virtual BOOL OnTransaction();
  41. BOOL OnTransaction_();
  42. protected:
  43. virtual DWORD ThreadProc();
  44. public:
  45. LARGE_INTEGER& GetFailureCount() { return m_liFailureCount; }
  46. LARGE_INTEGER& GetSuccessCount() { return m_liSuccessCount; }
  47. private:
  48. CLgEvent m_AttachEvent;
  49. CLgEvent m_PauseEvent;
  50. BOOL m_bPause;
  51. INT m_nCurrentDevice;
  52. protected:
  53. CProtocol *m_pProtocol;
  54. LARGE_INTEGER m_liFailureCount;
  55. LARGE_INTEGER m_liSuccessCount;
  56. };
  57. #endif