1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-24 22:13:15 +00:00

Fixing crash when shutting down the server

This commit is contained in:
Carles Fernandez 2015-12-23 00:56:21 +01:00
parent 9e009f48aa
commit 5bc26b3840
2 changed files with 5 additions and 4 deletions

View File

@ -102,9 +102,10 @@ void Rtcm::stop_service()
void Rtcm::stop_server()
{
std::cout << "Stopping TCP Server on port " << FLAGS_RTCM_Port << std::endl;
rtcm_message_queue->push("Goodbye"); // this kills tq
std::this_thread::sleep_for(std::chrono::seconds(1));
rtcm_message_queue->push("Goodbye"); // this terminates tq
Rtcm::stop_service();
servers.front().close_server();
std::this_thread::sleep_for(std::chrono::seconds(1));
server_is_running = false;
}

View File

@ -544,7 +544,7 @@ TEST(Rtcm_Test, InstantiateServer)
EXPECT_EQ(0, test4_bin.compare("11111111"));
}
/*
TEST(Rtcm_Test, InstantiateClient)
{
auto rtcm = std::make_shared<Rtcm>();
@ -555,6 +555,6 @@ TEST(Rtcm_Test, InstantiateClient)
rtcm->stop_client();
std::string test3_bin2 = rtcm->hex_to_bin(test3);
EXPECT_EQ(0, test3_bin2.compare("11111111"));
}
} */