Hello Jack,
I wonder if you can think of anything that I can hack around
just to see if it'll fix the problem?
I should try some workarounds following to see:
- First try to destroy the component same way in a temporary button
click. If that's work then I assume it has something to do with
My application halts when WSocketServer is freed, not every time
though. But it happens once in a few times when the application is
closed. Here's the code snippet:
if WSocketServer nil then
begin
WSocketServer.Abort();
Log('Server closed');
FreeAndNil(WSocketServer);
Hello Jack,
Do you have code in OnSessionClosed ? Because it will trigger with the
call to Abort. Set it to nil beforehand. Also this is not called from
within an event of TWSocketServer ?
---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz
Hello Jack,
I read your mail better now :) No need for Abort. Just Free the
component. Then OnSessionClose will not fire. What will fire is
OnChangeState, so be aware if you do things there like updating GUI or
so.
---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
Hello Wilfried,
Thanks for the quick reply. No, I don't have a OnSessionClose or
OnChangeState handler. Destroying the server object will abort the
socket? Anyway, I also removed Abort() but the problem is still
happening from time to time as before.
--
Best regards,
Jack
Saturday, March 4,
Hello Jack,
I'm checking the log again in your first mail:
main thread ($728):
7c90eb94 + ntdll.dll KiFastSystemCallRet
77d5f3de +0044 user32.dll SendMessageA
71ab8cc3 +489b WS2_32.dll WSACleanup
0048cdc4 +0018 Test.exe
Hello Wilfried,
It looks like it. But it could be SendMessageA called by
WSACleanup, which waits until SendMessageA message is processed.
Maybe this is because the target window and winproc has
been destroyed by TCustomWSocket.Destroy?
--
Best regards,
Jack
Saturday, March 4, 2006, 10:24:04
Hello Jack,
But it could be SendMessageA called by
Yes possible.
Jack can you try to make a simple new project to demonstrate the
behaviour ? I will be glad to try debug in it.
Wich delphi version do you use ?
---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
Hello Wilfried,
It's a little difficult to make a simple project out of it
because the project is kind of complicated already. Maybe I'll
do that when I'm not so busy.
I wonder if you can think of anything that I can hack around
just to see if it'll fix the problem?
--
Best regards,
Jack