The semaphore timeout period has expired

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
carlonarcisi
Posts: 29
Joined: Fri 10 Dec 2010 15:07

The semaphore timeout period has expired

Post by carlonarcisi » Mon 13 Jul 2015 09:41

I'm developing an application on a network particularly unstable.
some customers have often error "The semaphore timeout period has expired"
I've read the articles,
http://forums.devart.com/viewtopic.php?t=22418 (is for SDAC but i think is similar ...)

The event OnLostConnection I already use it and works perfectly !! but does not capture the error "The semaphore timeout period has expired"

obviously,certainly, that the network is unstable on my clients, but I would like to solve the problem via software because when I close and reopen my application all work perfectly ... until new semaphore timeout
What can I do in the event on error to reset the connection and try to restore it?
here is what I did .. but do not seem to work .. can you give me some idea?

Code: Select all

procedure TUniConnectEx.InternalConnectionError(Sender: Tobject; E: EDAError; var Fail: Boolean);
if (E.ErrorCode = 121) then
  // if E.ToString = 'TCP Provider: Periodo di timeout del semaforo scaduto.' .... "The semaphore timeout ...." then
  begin
      LinkedConnection.Disconnect; /// LinkedConnection is TUniConnection 
      LinkedConnection.Connect;
  end;

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: The semaphore timeout period has expired

Post by azyk » Thu 16 Jul 2015 13:39

Try using DisconnectedMode in unstable networks. To use it, set the TUniConnection.Options.DisconnectedMode property to True. See more details about DisconnectedMode in our documentation: https://www.devart.com/unidac/docs/?dev ... edmode.htm .

In addition, see our recommendation for using UniDAC in unstable network: https://www.devart.com/unidac/docs/?uns ... etwork.htm

Post Reply