Page 1 of 1

The semaphore timeout period has expired

Posted: Mon 13 Jul 2015 09:41
by carlonarcisi
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;

Re: The semaphore timeout period has expired

Posted: Thu 16 Jul 2015 13:39
by azyk
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