From 8b275c0b0a1064a813ef14a109b64e1fce461893 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Mon, 7 Aug 2017 20:08:15 +0500 Subject: 2017-08-07 --- src/NetworkClient.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/NetworkClient.cpp') diff --git a/src/NetworkClient.cpp b/src/NetworkClient.cpp index d944f54..5877952 100644 --- a/src/NetworkClient.cpp +++ b/src/NetworkClient.cpp @@ -51,7 +51,8 @@ void NetworkClient::SendPacket(std::shared_ptr packet) { void NetworkClient::NetworkLoop() { auto timeOfLastKeepAlivePacket = std::chrono::steady_clock::now(); el::Helpers::setThreadName("Network"); - LOG(INFO) << "Network thread is started"; + bool validEnded = true; + try { while (isActive) { toSendMutex.lock(); @@ -85,7 +86,7 @@ void NetworkClient::NetworkLoop() { } } } catch (std::exception &e) { - LOG(ERROR) << "Exception catched in NetworkLoop: " << e.what(); + EventAgregator::PushEvent(EventType::NetworkClientException, NetworkClientExceptionData{ e.what() }); + validEnded = false; } - LOG(INFO) << "Network thread is stopped"; -} +} \ No newline at end of file -- cgit v1.2.3