MCPcopy Create free account
hub / github.com/Icinga/icinga2 / ForceDisconnect

Method ForceDisconnect

lib/base/tlsstream.cpp:113–125  ·  view source on GitHub ↗

* Forcefully close the connection, typically (details are up to the operating system) using a TCP RST. */

Source from the content-addressed store, hash-verified

111 * Forcefully close the connection, typically (details are up to the operating system) using a TCP RST.
112 */
113void AsioTlsStream::ForceDisconnect()
114{
115 if (!lowest_layer().is_open()) {
116 // Already disconnected, nothing to do.
117 return;
118 }
119
120 boost::system::error_code ec;
121
122 // Close the socket. In case the connection wasn't shut down cleanly by GracefulDisconnect(), the operating system
123 // will typically terminate the connection with a TCP RST. Otherwise, this just releases the file descriptor.
124 lowest_layer().close(ec);
125}
126
127/**
128 * Try to cleanly shut down the connection. This involves sending a TLS close_notify shutdown alert and terminating the

Callers

nothing calls this directly

Calls 1

closeMethod · 0.80

Tested by

no test coverage detected