MCPcopy Create free account
hub / github.com/SIPp/sipp / reset_connection

Method reset_connection

src/socket.cpp:2266–2290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2264}
2265
2266void SIPpSocket::reset_connection()
2267{
2268 if (!reconnect_allowed()) {
2269 ERROR_NO("Max number of reconnections reached");
2270 }
2271
2272 if (reset_number != -1) {
2273 reset_number--;
2274 }
2275
2276 if (reset_close) {
2277 WARNING("Closing calls, because of TCP reset or close!");
2278 close_calls();
2279 }
2280
2281 /* Sleep for some period of time before the reconnection. */
2282 usleep(1000 * reset_sleep);
2283
2284 if (reconnect() < 0) {
2285 WARNING_NO("Could not reconnect TCP socket");
2286 close_calls();
2287 } else {
2288 WARNING("Socket required a reconnection.");
2289 }
2290}
2291
2292/* Close just those calls for a given socket (e.g., if the remote end closes
2293 * the connection. */

Callers 1

traffic_threadFunction · 0.80

Calls 4

reconnect_allowedFunction · 0.85
ERROR_NOFunction · 0.85
WARNINGFunction · 0.85
WARNING_NOFunction · 0.85

Tested by

no test coverage detected