MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / drain

Method drain

src/plugin/ipc/socket/socketconnlist.cpp:139–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139void
140SocketConnList::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
166void
167SocketConnList::preCkpt()

Callers 1

drainFdMethod · 0.45

Calls 5

monitorSocketsMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
getConnectionMethod · 0.80
onErrorMethod · 0.80

Tested by

no test coverage detected