My IB Gateway version is latest stable 10.30.1t, API version is latest stable 10.30.01 running on Windows. I replicated this on the sample TestCppClientStatic (debug, both win32 and x64). 1) start IB gateway, 2) start TestCppClientStatic, 3) shutdown IB gateway, 4) the program hangs. After putting a breakpoint at m_pEReader->stop() in void EClientSocket::eDisconnect(bool resetState), it seems the hang happened at WaitForSingleObject in EReader::stop(). See call stack below.
?
--hang here --> WaitForSingleObject(m_hReadThread, INFINITE);
> ? ?TestCppClientStatic.exe!EReader::stop() Line 70 ? ?C++
? ? ?TestCppClientStatic.exe!EClientSocket::eDisconnect(bool resetState) Line 241 ? ?C++
? ? ?TestCppClientStatic.exe!EClientSocket::onClose() Line 370 ? ?C++
? ? ?TestCppClientStatic.exe!EClientSocket::receive(char * buf, unsigned int sz) Line 274 ? ?C++
? ? ?TestCppClientStatic.exe!EReader::onReceive() Line 191 ? ?C++
? ? ?TestCppClientStatic.exe!EReader::processNonBlockingSelect() Line 173 ? ?C++
? ? ?TestCppClientStatic.exe!EReader::readToQueue() Line 93 ? ?C++
? ? ?TestCppClientStatic.exe!EReader::readToQueueThread(void * lpParam) Line 85 ? ?C++