diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp index 285642201..b745ea940 100644 --- a/server/CVCMIServer.cpp +++ b/server/CVCMIServer.cpp @@ -471,26 +471,20 @@ void CVCMIServer::loadGame() c << ui8(0); - CConnection* cc; //tcp::socket * ss; - for(int i=0; i(acceptor->get_io_service()); + acceptor->accept(*s,error); + if(error) //retry { - cc = &c; + logNetwork->warn("Cannot establish connection - retrying..."); + i--; + continue; } - else - { - auto s = new boost::asio::ip::tcp::socket(acceptor->get_io_service()); - acceptor->accept(*s,error); - if(error) //retry - { - logNetwork->warn("Cannot establish connection - retrying..."); - i--; - continue; - } - cc = new CConnection(s,NAME); - } - gh.conns.insert(cc); + + gh.conns.insert(new CConnection(s.release(),NAME)); } gh.run(true);