recovering from a closed TCP connection

main
Tom Early 2 years ago
parent f85434420b
commit c8972f8075

@ -250,17 +250,12 @@ void CController::ReadReflectorThread()
{ {
while (keep_running) while (keep_running)
{ {
// preemptively check the connection(s)...
tcClient.ReConnect();
std::queue<std::unique_ptr<STCPacket>> queue; std::queue<std::unique_ptr<STCPacket>> queue;
// wait up to 100 ms to read something on the unix port // wait up to 100 ms to read something on the unix port
if (tcClient.Receive(queue, 100)) tcClient.Receive(queue, 100);
{
if (tcClient.ReConnect())
{
std::cerr << "Unrecoverable ERROR! Quitting..." << std::endl;
exit(1);
}
}
while (! queue.empty()) while (! queue.empty())
{ {
// create a shared pointer to a new packet // create a shared pointer to a new packet

Loading…
Cancel
Save

Powered by TurnKey Linux.