#1 2018-06-28 14:27:10

dualarrow
Member
From: Australia
Registered: 2018-06-28
Posts: 21

Query on connection timeouts and debugging

Ive just started with mormot and after a lot of reading, it feels like a great piece of software.

What I'm trying is a variation of some of the samples in the documentation. If I let the program run without delay (ie no breakpoints) it works as expected, but if I go to the debugger on code like the following on the client

procedure TForm12.Test;
Var
  ans: Integer;
begin
  ans := 0;
  GModel := TSqlModel.Create([], ROOT_NAME);
//  GClient := TSQLHttpClientWinSock.Create('127.0.0.1','888',GModel);
  GClient := TSQLHttpClientWebSockets.Create('127.0.0.1','888',GModel,100000,100000,100000);
  GClient.WebSocketsUpgrade('super secret');
  GClient.ServiceDefine([ICalculator], sicShared);
  if GClient.Services['Calculator'].Get(I) then
  Begin
    ans := I.Add(3,4);
  End;
  Memo1.Lines.Add(IntToStr(ans));


  I := Nil;
  GClient.Free;
  GModel.Free;
end;

if I step up to the line that reads "ans := I.Add(3,4);" if theres more than about a 5 seconds delay I get an exception "ECrtSocket with message 'SndLow 10053 WSAECONNABORTED [An established connection was aborted by the software in your host machine]"

As you can see from the example above I have a large value in the timeouts, but I suspect its the server side dropping the connection based on the exception. I can put the line in a loop of 10000 and it runs fine outside of the debugger.

Is there some type of lifetime for the connection on the server that I havent found yet ?

The relevent part of the server code is

  SqLite3 := TSQLite3LibraryDynamic.Create;
  GModel := TSQLModel.Create([], ROOT_NAME);
  GServer := TSQLRestServerDb.Create(GModel);
  GServer.ServiceDefine(TServiceCalculator, [ICalculator], sicShared);
  GHTTPServer := TSQLHttpServer.Create(PORT_NAME, [GServer], '+', useHttpApiRegisteringURI);

  GHTTPServer.AccessControlAllowOrigin := '*';

but I couldnt find anything obvious where a connection or idle timeout could be set.

Is there a limit and is it possible to set this limit ?

Offline

#2 2018-06-28 16:18:42

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Query on connection timeouts and debugging

Are you using the latest version of the framework?
Current is 1.18.4646.

Offline

#3 2018-06-29 00:29:13

dualarrow
Member
From: Australia
Registered: 2018-06-28
Posts: 21

Re: Query on connection timeouts and debugging

How do I determine the version ? The files mention 1.18 but no release number. It was downloaded yesterday from the github mirror.

Offline

#4 2018-06-29 14:37:26

tbo
Member
Registered: 2015-04-20
Posts: 353

Re: Query on connection timeouts and debugging

You can find the current version number in the file "SynopseCommit.inc".

Offline

#5 2018-06-29 21:04:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Query on connection timeouts and debugging

Any version downloaded yesterday from the github mirror should be recent enough.

Offline

#6 2018-06-30 02:22:36

dualarrow
Member
From: Australia
Registered: 2018-06-28
Posts: 21

Re: Query on connection timeouts and debugging

Ok, version in SynopseCommit.inc is 1.18.4643

Offline

Board footer

Powered by FluxBB