add (un)registerEventListener() as a member function
parent
6944bba622
commit
9c66a81292
|
@ -97,13 +97,25 @@ PEP_STATUS get_gpg_path(const char** path)
|
|||
|
||||
PEP_STATUS registerEventListener(Context* ctx, std::string address, unsigned port, std::string securityContext)
|
||||
{
|
||||
// TODO: implement it!
|
||||
JsonAdapter* ja = dynamic_cast<JsonAdapter*>(ctx);
|
||||
if(!ja)
|
||||
{
|
||||
return PEP_STATUS(-42);
|
||||
}
|
||||
|
||||
ja->registerEventListener(address, port, securityContext);
|
||||
return PEP_STATUS_OK;
|
||||
}
|
||||
|
||||
PEP_STATUS unregisterEventListener(Context* ctx, std::string address, unsigned port, std::string securityContext)
|
||||
{
|
||||
// TODO: implement it!
|
||||
JsonAdapter* ja = dynamic_cast<JsonAdapter*>(ctx);
|
||||
if(!ja)
|
||||
{
|
||||
return PEP_STATUS(-42);
|
||||
}
|
||||
|
||||
ja->unregisterEventListener(address, port, securityContext);
|
||||
return PEP_STATUS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,9 @@ public:
|
|||
JsonAdapter(const JsonAdapter&) = delete;
|
||||
void operator=(const JsonAdapter&) = delete;
|
||||
|
||||
void registerEventListener(const std::string& address, unsigned port, const std::string& securityContext);
|
||||
void unregisterEventListener(const std::string& address, unsigned port, const std::string& securityContext);
|
||||
|
||||
// run the server in another thread and returns immediately.
|
||||
void run();
|
||||
|
||||
|
|
Loading…
Reference in New Issue