BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Strange delay on TSocketConnection disconnect

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Multi-Tier)
View previous topic :: View next topic  
Author Message
V.Valev
Guest





PostPosted: Thu Jan 12, 2006 2:44 pm    Post subject: Strange delay on TSocketConnection disconnect Reply with quote



Hi all,

I'm using TSocketConnection to connect to a Remote Data Module (Delphi 7).
Everything works fine, but on some machines there's a 3 minutes dalay when
disconnecting the socket connection (SocketConnection.Connected := False).
After tracing the problem in SConnect.pas, I found that the delay is at the
TStreamedConnection.InternalClose method:

WaitForSingleObject(FTransport.Handle, 180000);

For any reason, the Transport thread is not terminated, so
WaitForSingleObject timeout's. The machines that this occures are with
Windows XP SP2. But there are machines with same configuration that the
problem doesn't persist.

I've searched the net for that problem, but with no result. I found that
similar behaviour could be resulted if the thread is suspended when
Terminated is called or if the thread synchronizes to the main VCL thread.
In my case none of this happens (as far as I traced into the borland's
code).

I've temporarly decided the problem by changing the timeout to 3 seconds.
Would that be a problem?

Anyone seen this problem? Any suggestions?

Thanks in advance.


Back to top
Wayne
Guest





PostPosted: Fri Jan 13, 2006 1:40 pm    Post subject: Re: Strange delay on TSocketConnection disconnect Reply with quote



I have had the same problem, but it is not a consistent problem. Some times
it disconnects OK and sometimes it will wait the 3 minutes. I have not been
able to determine what causes it. Like you, I was hesitant to change the
timeout.

Wayne

"V.Valev" <val.valev (AT) abv (DOT) bg> wrote

Quote:
Hi all,

I'm using TSocketConnection to connect to a Remote Data Module (Delphi 7).
Everything works fine, but on some machines there's a 3 minutes dalay when
disconnecting the socket connection (SocketConnection.Connected := False).
After tracing the problem in SConnect.pas, I found that the delay is at
the
TStreamedConnection.InternalClose method:

WaitForSingleObject(FTransport.Handle, 180000);

For any reason, the Transport thread is not terminated, so
WaitForSingleObject timeout's. The machines that this occures are with
Windows XP SP2. But there are machines with same configuration that the
problem doesn't persist.

I've searched the net for that problem, but with no result. I found that
similar behaviour could be resulted if the thread is suspended when
Terminated is called or if the thread synchronizes to the main VCL thread.
In my case none of this happens (as far as I traced into the borland's
code).

I've temporarly decided the problem by changing the timeout to 3 seconds.
Would that be a problem?

Anyone seen this problem? Any suggestions?

Thanks in advance.





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Multi-Tier) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.