Hi!
I have an iPAQ 3600 with PocketPC 2000, and I want to
write a server application that accepts incoming
connections using the CCeSocket class.
I know that I have to derive from that class and override
the OnAccept method and so on, but try the following code:
CCeSocket *mySock;
mySock = new CCeSocket( CCeSocket::FOR_LISTENING );
mySock->Create();
delete mySock;
Everything is fine as long as I don't delete my object, then system
pauses. I see such code in the destructor:
code:------------------------------------------------------
--------------------------~CCeSocket()
{
//...
if (m_pListenThread)
{
while (::GetExitCodeThread (m_pListenThread->m_hThread,
&dwCode) )
{
if (dwCode == STILL_ACTIVE)
{
Sleep(50);
}
}
gCeSocketCS.Lock();
delete m_pListenThread;
m_pListenThread = 0;
gCeSocketCS.Unlock();
}
}
-----------------------------------------------------------
---------------------
it means, that if ListenThread returns 0 (normal exit),
then while-cycle never ends. I think they just
forgotten "else break;" as in the code of CCeSocket (FOR_DATA), in
fact the problem nto exist if the CCeSocket is created (FOR_DATA)!
how to solve this problem? Can i modify MFC source file and so
MFC300.dll? How?
Thank you,
Antonio