Joel Harris
2003-09-19 14:42:05 UTC
I posted this in the atozed forums a while back but either the forums are
messed up or my reader is.
Here are the simple steps to reproduce what appears to be a bug in
TIdTCPServer. Can anybody reproduce/confirm?
Am I crazy? This always causes me a Terminate Thread Timeout error when
shutting down the server while a client is connected.
1) Create an app with a TIdTCPServer component.
2) Set the IdTCPServer DefaultPort to whatever. Leave other properties as
default
3) In the IdTCPServer.Connect event handler do the following...
Coinitialize(nil); //requires unit ActiveX
AThread.Data := TMyDataModule.Create(nil); //TMyDataModule is created in
step 8
4) In the IdTCPServer.Disconnect event handler do this...
Couninitialize;//requires unit ActiveX as well
5) Create an event handler for the IdTCPServer.OnExecuteEvent and do
whatever inside it. I left it empty for testing purposes
6) In the form's OnCreate event handler set the IdTCPServer.Active property
to true.
7) In the form's OnDestroy event handler set the IdTCPServer.Active
property to false.
8) Now add a brand new data module to the project and name it MyDataModule.
No need to add anything to the data module.
9) Include the data module unit in your main unit's uses clause.
Create a simple client app to connect to the server. Run the server. Run
the client and connect it to the server. Then close the server. Boom. It
happens to me every time.
I am using Indy 9.0.14 and Delphi 7 on Windows XP
If anyone can tell me what is going wrong here I will appreciate it very
much.
Thanks.
Joel Harris
Ebbhead89
--
remove XYZ from contact address
messed up or my reader is.
Here are the simple steps to reproduce what appears to be a bug in
TIdTCPServer. Can anybody reproduce/confirm?
Am I crazy? This always causes me a Terminate Thread Timeout error when
shutting down the server while a client is connected.
1) Create an app with a TIdTCPServer component.
2) Set the IdTCPServer DefaultPort to whatever. Leave other properties as
default
3) In the IdTCPServer.Connect event handler do the following...
Coinitialize(nil); //requires unit ActiveX
AThread.Data := TMyDataModule.Create(nil); //TMyDataModule is created in
step 8
4) In the IdTCPServer.Disconnect event handler do this...
Couninitialize;//requires unit ActiveX as well
5) Create an event handler for the IdTCPServer.OnExecuteEvent and do
whatever inside it. I left it empty for testing purposes
6) In the form's OnCreate event handler set the IdTCPServer.Active property
to true.
7) In the form's OnDestroy event handler set the IdTCPServer.Active
property to false.
8) Now add a brand new data module to the project and name it MyDataModule.
No need to add anything to the data module.
9) Include the data module unit in your main unit's uses clause.
Create a simple client app to connect to the server. Run the server. Run
the client and connect it to the server. Then close the server. Boom. It
happens to me every time.
I am using Indy 9.0.14 and Delphi 7 on Windows XP
If anyone can tell me what is going wrong here I will appreciate it very
much.
Thanks.
Joel Harris
Ebbhead89
--
remove XYZ from contact address