COMSocket::COMSocket(int nSocket, int nSockType)
{
    m_nSocket = nSocket;
    if (m_nSocket != INVALID_SOCKET)
        m_bConnected = true;
    m_nSockType = nSockType;
}

needs to set m_bConnected to false, either at the beginning of the function
or through the addition of an else clause to accompany the if statement
above.

otherwise, when the player shuts down:

TYPICAL_DELETE(m_APSInterface);
..
deletes m_pYClient in its destructor
...
which deletes m_pSocket in its destructor
...
which tries to disconnect m_pSock in its destructor:
if (m_pSock->IsConnected()) m_pSock->Disconnect();
...
in which case, the socket returns 0xCD (true) instead of 0x00 (false)
...
which finally takes extra time to do nothing & returns a socket shutdown
error:

/** Disconnects the current socket */
int COMSocket::Disconnect()
{
    int nErr = 0;
    if (!IsConnected())
        return SOCKET_ERROR;

    if (m_nSockType == SOCK_STREAM)
    {
==>     nErr = shutdown(m_nSocket, 2);
    }

    nErr = closesocket(m_nSocket);
    m_nSocket = INVALID_SOCKET;
    m_bConnected = false;
    return (nErr != SOCKET_ERROR) - 1;
}

_______________________________________________
[EMAIL PROTECTED]
http://www.freeamp.org/mailman/listinfo/freeamp-dev

Reply via email to