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.

66 lines
2.5 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: LgRemoteServerTcpIpConnection.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of LgRemoteServerTcpIpConnection.h
  13. //----------------------------------------------------------------------------
  14. #ifndef __VIDEO__SERVER__CONNECTION__H__INCLUDED__
  15. #define __VIDEO__SERVER__CONNECTION__H__INCLUDED__
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #include "..\..\LgLib\Socket\LgSocketServerConnection.h"
  20. #include "LgRemoteSocket.h"
  21. #include "LgRemoteServerTcpIp.h"
  22. const int CLgRemoteServerTcpIpConnectionMaster = 0;
  23. const int CLgRemoteServerTcpIpConnectionSlave = 1;
  24. class CLgRemoteServerTcpIpConnection :
  25. public CLgSocketServerConnection<CLgRemoteSocket>,
  26. public CLgCriticalSection,
  27. public CLgLinkSP<CLgRemoteServerTcpIpConnection,CLgRemoteServerTcpIpSession,CLgRemoteServerTcpIpConnectionMaster>,
  28. public CLgLinkSP<CLgRemoteServerTcpIpConnection,CLgRemoteServerTcpIpSession,CLgRemoteServerTcpIpConnectionSlave>
  29. {
  30. public:
  31. typedef CLgLinkSP<CLgRemoteServerTcpIpConnection,CLgRemoteServerTcpIpSession,CLgRemoteServerTcpIpConnectionMaster> ConnectionToSessionMasterLinkSP;
  32. typedef CLgLinkSP<CLgRemoteServerTcpIpConnection,CLgRemoteServerTcpIpSession,CLgRemoteServerTcpIpConnectionSlave> ConnectionToSessionSlaveLinkSP;
  33. public:
  34. CLgRemoteServerTcpIpConnection( CLgRemoteServerTcpIp *pServer );
  35. virtual ~CLgRemoteServerTcpIpConnection();
  36. private:
  37. virtual void OnPacketVideo( PLG_TCP_PACKET_VIDEO pReceivePacket );
  38. virtual void OnPacketPTZ( PLG_TCP_PACKET_PTZ pReceivePacket );
  39. virtual void OnPacketLGS( PLG_TCP_PACKET_LGS pReceivePacket );
  40. virtual void OnPacketReport( PLG_TCP_PACKET_REPORT pReceivePacket );
  41. virtual void OnPacketBoardReceiver( PLG_TCP_PACKET_BOARD_RECEIVER pReceivePacket );
  42. virtual void OnPacketConnect( PLG_TCP_PACKET_CONNECT pReceivePacket );
  43. virtual void OnPacketSessionInfo( PLG_TCP_PACKET_SESSION_INFO pReceivePacket );
  44. public:
  45. void SetType( BOOL bMaster ) { m_bMasterType = bMaster; }
  46. BOOL IsMaster() { return m_bMasterType; }
  47. INT GetConnectionID() { return m_nConnectionID; }
  48. private:
  49. BOOL m_bMasterType;
  50. INT m_nConnectionID;
  51. BYTE m_nConnectionType;
  52. protected:
  53. friend class CLgRemoteServerTcpIpSession;
  54. };
  55. #endif