| 138 | } |
| 139 | |
| 140 | BOOST_AUTO_TEST_CASE(test_ssl_interruptable_child_read_while_handshaking) { |
| 141 | shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory(); |
| 142 | TSSLServerSocket sock1("localhost", 0, pServerSocketFactory); |
| 143 | sock1.listen(); |
| 144 | int port = sock1.getPort(); |
| 145 | shared_ptr<TSSLSocketFactory> pClientSocketFactory = createClientSocketFactory(); |
| 146 | shared_ptr<TSSLSocket> clientSock = pClientSocketFactory->createSocket("localhost", port); |
| 147 | clientSock->open(); |
| 148 | shared_ptr<TTransport> accepted = sock1.accept(); |
| 149 | boost::thread readThread(std::bind(readerWorkerMustThrow, accepted)); |
| 150 | boost::this_thread::sleep(boost::posix_time::milliseconds(50)); |
| 151 | // readThread is practically guaranteed to be blocking now |
| 152 | sock1.interruptChildren(); |
| 153 | BOOST_CHECK_MESSAGE(readThread.try_join_for(boost::chrono::milliseconds(20)), |
| 154 | "server socket interruptChildren did not interrupt child read"); |
| 155 | clientSock->close(); |
| 156 | accepted->close(); |
| 157 | sock1.close(); |
| 158 | } |
| 159 | |
| 160 | BOOST_AUTO_TEST_CASE(test_ssl_interruptable_child_read) { |
| 161 | shared_ptr<TSSLSocketFactory> pServerSocketFactory = createServerSocketFactory(); |
nothing calls this directly
no test coverage detected