udp socket.create() -> sometimes _callthreadstartex unhandled exception
Hi,
sometimes I get an unhandled exception during the casyncscocket
creation process of my udp socket type...
/* socket.create m_socket */
if(!m_socket.Create(PORT_ARTNET, SOCK_DGRAM, FD_READ))
{
DWORD err = ::GetLastError();
ASSERT(target != NULL);
return FALSE;
}
The exception occur in the sockcore.cpp file (within the
Socket(nSocketType, IEvent) line. I don`t know the meaning of this
exception, but if I go ahead after this exception (without starting
the debugger again) the socket is working....
BOOL CAsyncSocket::Create(UINT nSocketPort, int nSocketType,
long lEvent, LPCTSTR lpszSocketAddress)
{
if (Socket(nSocketType, lEvent))
{
if (Bind(nSocketPort,lpszSocketAddress))
return TRUE;
int nResult = GetLastError();
Close();
WSASetLastError(nResult);
}
return FALSE;
}
the exact line of the exception if I stop the programm is (return 0) -
in the threadex.c file:
#endif /* defined (_M_CEE) || defined (MRTDLL) */
_callthreadstartex();
/*
* Never executed!
*/
return(0L);
}
Is my code getting an udp socket correct? or are there any mistakes? I
have to use udp instead of tcp, because the protocol I have to use,
use udp....
best regards
Hans