From: Elvandar on
Norbert Unterberg explained :
> Elvandar schrieb:
>> Elvandar has brought this to us :
>>> Hi all. I wrote an MFC application to make an HTTP file transfer between a
>>> client and a server. The application receives as input the list of servers
>>> to call (in this case, servers are remote devices with an embedded web
>>> server), and one by one it sends the file and closes the connection. The
>>> sequence of the operations made is this:
>>>
>>> [CUT]
>>
>> Ok, doesn't matter. Just a fast search with google groups to find out it is
>> a bug in vc++ 6 without sp3... :) I solved with a workaround!
>
> I hope the workaround was to install VC++ SP6!
>
> Norbert

Unfortunately I can't install SP6 (the boss is always the boss :) ), so
the workaround I had to use is this:

#ifndef _AFXDLL
// Workaround bug in VC6
// MS BUG Q193101
#define _AFX_SOCK_THREAD_STATE AFX_MODULE_THREAD_STATE
#define _afxSockThreadState AfxGetModuleThreadState()

_AFX_SOCK_THREAD_STATE* pState = _afxSockThreadState;
if (pState->m_pmapSocketHandle == NULL)
pState->m_pmapSocketHandle = new CMapPtrToPtr;
if (pState->m_pmapDeadSockets == NULL)
pState->m_pmapDeadSockets = new CMapPtrToPtr;
if (pState->m_plistSocketNotifications == NULL)
pState->m_plistSocketNotifications = new CPtrList;
#endif

It seems to work, so for now I'll continue using this, hoping to
install sp6 as soon as possible! :)