Implements rudimentary thread-safety for EventBus and Logger classes.
This commit is contained in:
1 parent
34e1dd0c33
commit
fb35fbd350
6 files changed
+66
-31
No files matched your search
@@ -12,6 +12,7 @@ namespace Plains {
|
||||
namespace Resolver {
|
||||
|
||||
using asio::ip::udp;
|
||||
using asio::ip::tcp;
|
||||
|
||||
static char* byteToHex(char c) {
|
||||
static char* out = new char[3];
|
||||
@@ -93,9 +94,12 @@ Server::Server(Logger& logger, EventBus& eventBus)
|
||||
_udpSocket = new udp::socket(_ioContext, udp::endpoint(udp::v4(), 8853));
|
||||
_ioContext.run();
|
||||
doReceive();
|
||||
_logger.debug.ln ("Resolver started");
|
||||
}
|
||||
|
||||
Server::~Server() {}
|
||||
Server::~Server() {
|
||||
_udpSocket->close();
|
||||
}
|
||||
|
||||
//void Server::run() {
|
||||
// _ioContext.run();
|
||||
@@ -129,4 +133,6 @@ void Server::doSend(std::size_t length)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}}
|
||||
Reference in new issue
Block a user