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.

41 lines
1.8 KiB

2 years ago
​
​
​
2 years ago
​
2 years ago
2 years ago
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
​
2 years ago
​
2 years ago
​
2 years ago
​
​
​
  1. #ifndef __ARGUS_RPC_CLIENT_HANDLER__
  2. #define __ARGUS_RPC_CLIENT_HANDLER__
  3. #include "../../data/net/netClientHandler.h"
  4. #include "../../data/protocol/protocol.h"
  5. #include "../../data/protocol/protocolARGUS_DATA.h"
  6. class servaRemoteClient;
  7. typedef struct S_SESSION_EVENT{
  8. uint64_t db_id;
  9. }SESSION_EVENT;
  10. typedef std::vector<SESSION_EVENT> V_SESSION_EVENTS;
  11. class servaRPCHadnler: public networkClientHandler, public protocolParser{
  12. private:
  13. servaRemoteClient * m_pMaster;
  14. char m_cRemoteIP[64];
  15. char m_cRemoteIdentity[64];
  16. uint64_t m_dRemoteMojoDBID;
  17. uint64_t m_dRemoteUpperDBID;
  18. uint64_t m_dRemoteBottomDBID;
  19. bool m_bSessionIsActive;
  20. V_SESSION_EVENTS m_vSessionPool;
  21. bool peer_send_ack_evt( uint64_t evt_dbid, CSTR uuid );
  22. bool peer_send_req_draw( uint8_t sensor, uint8_t draw_type = ARGUS_RPC_DRAW_TYPE_FAST, bool getexisted = true );
  23. bool peer_send_reg_status( uint8_t status );
  24. bool peer_send_time_sync_ack( ARGUS_DATA_TIME_SYNC_ACK *ptr );
  25. protected:
  26. virtual int packetChecker(U8 *Buffer, size_t BufferSize);
  27. virtual protocolPackage * packetExtractor(U8 *Buffer, size_t BufferSize);
  28. virtual bool packetHandler( protocolPackage *Package );
  29. public:
  30. explicit servaRPCHadnler( int SocketFD, networkServiceEngine *ptr );
  31. ~servaRPCHadnler();
  32. virtual bool attachEngine( networkServiceEngine *ptr );
  33. virtual void dispatchEvent( EVENT_CONTAINER *Evt );
  34. virtual bool getStatus( void );
  35. bool setRemotePeerIP( CSTR ptr );
  36. };
  37. #endif