Arno Garrels wrote:
> h visli wrote:
>> Please follow those steps:
>> 1, Run OverbyteIcsThrdSrv.exe in the IDE.
>> 2, Run OverbyteIcsTelnetClient.exe, and connect to the server.
>> 3, Input some words(e.g.: 'help'), and don't press Enter key, then
>> close OverbyteIcsTelnetClient.exe directly. you will get the
>> exception message: "Cannot detach from another thread".
> True, I'm able to reproduce this with latest ICS v7 and D2010
> Thanks for reporting.
It is a simple Deadlock in the demo.
If there is still data to be displayed in the memo when a Client
disconnects (which is synchronized with TThread.Synchronize) the
WM_QUIT message posted in "TTcpSrvForm.WSocketServer1ClientDisconnect()"
does not kill thread's message pump until
"WaitForSingleObject(ClientThread.Handle, 10000);" timed out.
As a result the client object has already been freed when
"WSocket.ThreadDetach" is called in method Excecute.
You may get either AVs since a method of an already freed object is
called or error "Cannot detach from another thread" since property
TWSocket.ThreadID was reset to "0" in the destructor.
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be