| 1062 | } |
| 1063 | |
| 1064 | bool TNonblockingServer::drainPendingTask() { |
| 1065 | if (threadManager_) { |
| 1066 | std::shared_ptr<Runnable> task = threadManager_->removeNextPending(); |
| 1067 | if (task) { |
| 1068 | TConnection* connection = static_cast<TConnection::Task*>(task.get())->getTConnection(); |
| 1069 | assert(connection && connection->getServer() && connection->getState() == APP_WAIT_TASK); |
| 1070 | connection->forceClose(); |
| 1071 | return true; |
| 1072 | } |
| 1073 | } |
| 1074 | return false; |
| 1075 | } |
| 1076 | |
| 1077 | void TNonblockingServer::expireClose(std::shared_ptr<Runnable> task) { |
| 1078 | TConnection* connection = static_cast<TConnection::Task*>(task.get())->getTConnection(); |
nothing calls this directly
no test coverage detected