38 lines
832 B
C++
38 lines
832 B
C++
#ifndef INCLUDE_DI_RPC_CLASS_CONNECTION_H_
|
|
#define INCLUDE_DI_RPC_CLASS_CONNECTION_H_
|
|
|
|
#include <vector>
|
|
#include <di/rpc/Msg.h>
|
|
|
|
namespace Di {
|
|
namespace Rpc {
|
|
|
|
class Connection : public Msg {
|
|
public:
|
|
struct connectionConnect {
|
|
std::string peer;
|
|
};
|
|
|
|
struct connectionDisconnect {
|
|
std::string peer;
|
|
int32_t error = 0;
|
|
};
|
|
|
|
std::vector<connectionConnect> connectionConnectList;
|
|
std::vector<connectionDisconnect> connectionDisconnectlist;
|
|
|
|
explicit Connection(std::shared_ptr<Msg> msg);
|
|
|
|
private:
|
|
void __decodeMethodeConnect(std::shared_ptr<Json> message);
|
|
void __decodeMethodeDisconnect(std::shared_ptr<Json> message);
|
|
|
|
std::string __getPeer(std::shared_ptr<Json> message);
|
|
int32_t __getError(std::shared_ptr<Json> message);
|
|
};
|
|
|
|
} // namespace Rpc
|
|
} // namespace Di
|
|
|
|
#endif // INCLUDE_DI_RPC_CLASS_CONNECTION_H_
|