Exemple #1
0
CBaseIOStream::~CBaseIOStream(void)
{
	if (m_socket != S_INVALID_SOCKET)
	{
		S_CloseSocket(m_socket);
	}
	m_pio = NULL;
}
void CBaseIOStream::Close()
{
    if (m_socket != S_INVALID_SOCKET)
    {
        if (m_pio)
        {
            m_pio->Remove_Handler(this);
        }
        S_CloseSocket(m_socket);
        m_socket = S_INVALID_SOCKET;
    }
}
void CSSLClientAsync::_Close()
{
    if (m_ssl)
    {
        UnInitSSL();
    }
    if (GetSocket() != S_INVALID_SOCKET)
    {
        if (m_pio)
        {
            m_pio->Remove_Handler(this);
        }
        SetSSLConnectStatus(FALSE);
        S_CloseSocket(GetSocket());
        SOCKET_IO_WARN("close ssl socket, sock %d, real sock: %d.", GetSocketID(), GetSocket());
        m_socket = S_INVALID_SOCKET;
        DoClose(GetSocketID());
        _ClearSendBuffer();
    }
}