| 137 | } |
| 138 | |
| 139 | void |
| 140 | SocketConnList::drain() |
| 141 | { |
| 142 | // First, let all the Connection prepare for drain |
| 143 | ConnectionList::drain(); |
| 144 | |
| 145 | // this will block until draining is complete |
| 146 | KernelBufferDrainer::instance().monitorSockets(DRAINER_CHECK_FREQ); |
| 147 | |
| 148 | // handle disconnected sockets |
| 149 | const map<ConnectionIdentifier, vector<char> > &discn = |
| 150 | KernelBufferDrainer::instance().getDisconnectedSockets(); |
| 151 | |
| 152 | map<ConnectionIdentifier, vector<char> >::const_iterator it; |
| 153 | for (it = discn.begin(); it != discn.end(); it++) { |
| 154 | const ConnectionIdentifier &id = it->first; |
| 155 | TcpConnection *con = |
| 156 | (TcpConnection *)SocketConnList::instance().getConnection(id); |
| 157 | JTRACE("recreating disconnected socket") (id); |
| 158 | |
| 159 | // reading from the socket, and taking the error, resulted in an |
| 160 | // implicit close(). |
| 161 | // we will create a new, broken socket that is not closed |
| 162 | con->onError(); |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | void |
| 167 | SocketConnList::preCkpt() |
no test coverage detected