///////////////////////////////////////////////////////
| 944 | |
| 945 | //////////////////////////////////////////////////////////// |
| 946 | void TcpSocket::disconnect() |
| 947 | { |
| 948 | if (m_impl->tlsState) |
| 949 | { |
| 950 | if (m_impl->tlsState->handshakeComplete) |
| 951 | { |
| 952 | if (auto result = mbedtls_ssl_close_notify(&m_impl->tlsState->sslContext); |
| 953 | (result != 0 && result != MBEDTLS_ERR_SSL_WANT_READ && result != MBEDTLS_ERR_SSL_WANT_WRITE && |
| 954 | result != MBEDTLS_ERR_NET_CONN_RESET)) |
| 955 | err() << "Failed to notify TLS peer connection is being closed: " << tlsErrorString(result) << std::endl; |
| 956 | } |
| 957 | |
| 958 | m_impl->tlsState.reset(); |
| 959 | } |
| 960 | |
| 961 | // Close the socket |
| 962 | close(); |
| 963 | |
| 964 | // Reset the pending packet data |
| 965 | m_pendingPacket = PendingPacket(); |
| 966 | } |
| 967 | |
| 968 | |
| 969 | //////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected