Systemsicherheit/Assignment 7 - SGX Hands-on/SGX101_sample_code-master/RemoteAttestation/Networking/NetworkManagerServer.cpp

34 lines
688 B
C++
Raw Normal View History

#include "NetworkManagerServer.h"
NetworkManagerServer* NetworkManagerServer::instance = NULL;
NetworkManagerServer::NetworkManagerServer() {}
void NetworkManagerServer::Init() {
this->server = new Server(this->io_service, this->port);
}
NetworkManagerServer* NetworkManagerServer::getInstance(int port) {
if (instance == NULL) {
instance = new NetworkManagerServer();
instance->setPort(port);
}
return instance;
}
void NetworkManagerServer::startService() {
this->server->start_accept();
this->io_service.run();
}
void NetworkManagerServer::connectCallbackHandler(CallbackHandler cb) {
this->server->connectCallbackHandler(cb);
}