* Forcefully close the connection, typically (details are up to the operating system) using a TCP RST. */
| 111 | * Forcefully close the connection, typically (details are up to the operating system) using a TCP RST. |
| 112 | */ |
| 113 | void 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 |