Board index » delphi » TIdTCPServer,TIdPeerThread, its data property and the Terminate Thread Timeout error
Joel Harris
![]() Delphi Developer |
Joel Harris
![]() Delphi Developer |
TIdTCPServer,TIdPeerThread, its data property and the Terminate Thread Timeout error2003-09-11 01:19:19 PM delphi22 I am assigning an instance of a TDataModule descendant to the Data property of each TIdPeerThread in the OnConnect event handler of my TIdTCPServer object. If there is a client connected when I set the TCPServer.Active property to false I always get a Terminate Thread Timeout Error. I am not freeing the data module myself. I am allowing the thread to do it for me. If I do not assign anything to the data property the error does not occur. Besides not assigning anything to the data property, how do I fix this? I am using Indy 9.00.14 in Delphi 7 on windows XP Thanks much, Joel Harris Ebbhead89 |
Remy Lebeau (TeamB)
![]() Delphi Developer |
2003-09-11 02:29:16 PM
Re:TIdTCPServer,TIdPeerThread, its data property and the Terminate Thread Timeout error
"Joel Harris" <XXXX@XXXXX.COM>writes
QuoteIf there is a client connected when I set the TCPServer.Active time? What is the value of the server's TerminateWaitTime property? Before getting the timeout, are any of the thread's OnException event being triggered, by chance? Gambit --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (www.grisoft.com). Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03 |
Joel Harris
![]() Delphi Developer |
2003-09-11 10:31:30 PM
Re:TIdTCPServer,TIdPeerThread, its data property and the Terminate Thread Timeout error
"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes
QuoteWhat does your actual code look like? data module isn't used anywhere else, but it will be. procedure TMainForm.TCPServerConnect(AThread: TIdPeerThread); var ConnStr: string; dm: TServerDataModule; begin ConnStr := StringReplace(CONN_STRING,'[UN]',DBUN,[]); ConnStr := StringReplace(ConnStr,'[PW]',DBPW,[]); ConnStr := StringReplace(ConnStr,'[DB]',DB,[]); ConnStr := StringReplace(ConnStr,'[SERVER]',DBServer,[]); dm := TServerDataModule.Create(ConnStr, nil); AThread.Data := dm; PostMessage(Application.MainForm.Handle, WM_CONN_OPEN, integer(AThread), AddAtom(PChar(AThread.Connection.LocalName))); AThread.OnException := testerror; end; QuoteAre you assigning the same TDataModule to each thread or are you QuoteWhat is the value of the server's TerminateWaitTime property? QuoteBefore getting the timeout, are any of the thread's OnException event being |
m.wollert
![]() Delphi Developer |
2003-09-25 09:30:37 PM
Re:TIdTCPServer,TIdPeerThread, its data property and the Terminate Thread Timeout error
If itīs not possible for handling Athread.Sychronize(TMethod) have a
look at TCriticalSection. You NEVER should access VCL-Components during Thread.Execute (f.e. onConnect, onExecute, etc.) Have a lot of fun:) Michael:) |