How do I select a timeout other than infinite for connect?

Giganews Newsgroups
Subject: How do I select a timeout other than infinite for connect?
Posted by:  Ross McMillan (nospam@gmail.com)
Date: Thu, 24 Nov 2005

My application sends emails from a thread using Indy components. The email
thread ($d48) stopped sending emails and seems to be snagged in a call to
Connect.  I set the ConnectTimeout 10 10 secs but it still snags in the call
to Select (see MadExcept call stack dump below) .

TRacinf through the code, I can't see how the timeout could be anything
other than infinite.  I note there is the constant IdTimeoutDefault but it
is a CONST with a value of -1 which seems to translate to infinite .  Is
there no way of changing this without modifying the Indy source?  I could do
that but that creates problems when I want to update the Indy sources.

Many thanks,
Ross

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

thread $d48 (TPooledThreadedEmail):
7c90eb94 +000 ntdll.dll KiFastSystemCallRet
7c90e9be +00a ntdll.dll NtWaitForSingleObject
71aa150a +06a WS2HELP.dll WahReferenceContextByHandle
71ab2e64 +0a4 WS2_32.dll select
000e1ec4 +024 tad.exe IdStackWindows 816 +2 TIdSocketListWindows.FDSelect
000e1e88 +020 tad.exe IdStackWindows 805 +3 TIdSocketListWindows.SelectRead
000f2266 +006 tad.exe IdSocketHandle 484 +1 TIdSocketHandle.Select
000f204f +027 tad.exe IdSocketHandle 390 +2 CheckIsReadable
000f2107 +06b tad.exe IdSocketHandle 411 +15 TIdSocketHandle.Readable
000f45fa +006 tad.exe IdIOHandlerStack 399 +0 TIdIOHandlerStack.Readable
000f476f +077 tad.exe IdIOHandlerStack 451 +14
TIdIOHandlerStack.ReadFromSource
000f0b35 +14d tad.exe IdIOHandler 1131 +39 TIdIOHandler.ReadLn
000f09d1 +015 tad.exe IdIOHandler 1079 +1 TIdIOHandler.ReadLn
000f0d15 +03d tad.exe IdIOHandler 1180 +5 TIdIOHandler.ReadLnWait
000f921a +04e tad.exe IdTCPConnection 659 +5
TIdTCPConnection.GetInternalResponse
000f8ee5 +00d tad.exe IdTCPConnection 528 +1 TIdTCPConnection.GetResponse
000f8fc1 +041 tad.exe IdTCPConnection 548 +3 TIdTCPConnection.SendCmd
000f90bb +037 tad.exe IdTCPConnection 613 +2 TIdTCPConnection.SendCmd
00108d70 +080 tad.exe IdSMTPBase 213 +17 TIdSMTPBase.SendGreeting
0010a5af +02f tad.exe IdSMTP 399 +3 TIdSMTP.Connect
001787f5 +061 tad.exe tapmail 386 +14 TPooledThreadedEmail.Execute
0005f473 +02b tad.exe madExcept HookedTThreadExecute
000740bc +01c tad.exe Classes ThreadProc
00014150 +028 tad.exe System ThreadWrapper
0005f3c2 +036 tad.exe madExcept ThreadExceptFrame
>> created by main thread ($688) at:
00178537 +01f tad.exe tapmail 281 +1 TPooledThreadedEmail.Create

Replies