X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Fnntp%2Fnntplistener.cpp;h=01b008d86b7ee1db48839713c307a7b1a2176661;hp=29f8eb4752dbe442cec9c8c2ecf7a8d211cb8183;hb=964f55fd550fc711c0320ce6a24ad713040695d0;hpb=868c533e84b3c81b6604b45b84efa32073aa20b4 diff --git a/src/nntp/nntplistener.cpp b/src/nntp/nntplistener.cpp index 29f8eb4..01b008d 100644 --- a/src/nntp/nntplistener.cpp +++ b/src/nntp/nntplistener.cpp @@ -82,15 +82,30 @@ void NNTPListener::run() // see if any threads are still running - just calling interrupt without check would cause assert in debug mode if(m_connections.wait(1)==false) { + LogFile::instance()->WriteLog(LogFile::LOGLEVEL_DEBUG,"NNTPListener::run interrupting connection threads and waiting 60 seconds for exit."); try { m_connections.interrupt(); } catch(...) { + LogFile::instance()->WriteLog(LogFile::LOGLEVEL_DEBUG,"NNTPListener::run caught unhandled exception."); } - m_connections.wait(); + if(m_connections.wait(60)==false) + { + LogFile::instance()->WriteLog(LogFile::LOGLEVEL_DEBUG,"NNTPListener::run connection threads did not exit after 60 seconds."); + } + } + + for(listeni=m_listensockets.begin(); listeni!=m_listensockets.end(); listeni++) + { + #ifdef _WIN32 + closesocket((*listeni)); + #else + close((*listeni)); + #endif } + m_listensockets.clear(); }