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.
42 lines
1.8 KiB
42 lines
1.8 KiB
#ifndef __ARGUS_RPC_CLIENT_HANDLER__
|
|
#define __ARGUS_RPC_CLIENT_HANDLER__
|
|
|
|
#include "../../data/net/netClientHandler.h"
|
|
#include "../../data/protocol/protocol.h"
|
|
#include "../../data/protocol/protocolARGUS_DATA.h"
|
|
|
|
class servaRemoteClient;
|
|
typedef struct S_SESSION_EVENT{
|
|
uint64_t db_id;
|
|
|
|
}SESSION_EVENT;
|
|
typedef std::vector<SESSION_EVENT> V_SESSION_EVENTS;
|
|
class servaRPCHadnler: public networkClientHandler, public protocolParser{
|
|
private:
|
|
servaRemoteClient * m_pMaster;
|
|
char m_cRemoteIP[64];
|
|
char m_cRemoteIdentity[64];
|
|
uint64_t m_dRemoteMojoDBID;
|
|
uint64_t m_dRemoteUpperDBID;
|
|
uint64_t m_dRemoteBottomDBID;
|
|
bool m_bSessionIsActive;
|
|
V_SESSION_EVENTS m_vSessionPool;
|
|
bool peer_send_ack_evt( uint64_t evt_dbid, CSTR uuid );
|
|
bool peer_send_req_draw( uint8_t sensor, uint8_t draw_type = ARGUS_RPC_DRAW_TYPE_FAST, bool getexisted = true );
|
|
bool peer_send_reg_status( uint8_t status );
|
|
bool peer_send_time_sync_ack( ARGUS_DATA_TIME_SYNC_ACK *ptr );
|
|
protected:
|
|
virtual int packetChecker(U8 *Buffer, size_t BufferSize);
|
|
virtual protocolPackage * packetExtractor(U8 *Buffer, size_t BufferSize);
|
|
virtual bool packetHandler( protocolPackage *Package );
|
|
public:
|
|
explicit servaRPCHadnler( int SocketFD, networkServiceEngine *ptr );
|
|
~servaRPCHadnler();
|
|
virtual bool attachEngine( networkServiceEngine *ptr );
|
|
virtual void dispatchEvent( EVENT_CONTAINER *Evt );
|
|
virtual bool getStatus( void );
|
|
bool setRemotePeerIP( CSTR ptr );
|
|
};
|
|
|
|
|
|
#endif
|