From 30c0e2e5dd4b41081de00e04dea0bc4272e136bf Mon Sep 17 00:00:00 2001 From: Vinicius Sanchez Date: Thu, 4 May 2023 11:12:44 -0300 Subject: [PATCH] KeepConnectionAlive default is true --- samples/delphi/console/Console.dpr | 2 -- src/Horse.Provider.Abstract.pas | 2 +- src/Horse.Provider.Console.pas | 3 +++ src/Horse.Provider.Daemon.pas | 3 +++ src/Horse.Provider.VCL.pas | 3 +++ 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/samples/delphi/console/Console.dpr b/samples/delphi/console/Console.dpr index 0a6f841..f429575 100644 --- a/samples/delphi/console/Console.dpr +++ b/samples/delphi/console/Console.dpr @@ -8,8 +8,6 @@ uses System.SysUtils; begin - THorse.KeepConnectionAlive := True; - {$IFDEF MSWINDOWS} IsConsole := False; ReportMemoryLeaksOnShutdown := True; diff --git a/src/Horse.Provider.Abstract.pas b/src/Horse.Provider.Abstract.pas index 6c90ea8..30f5017 100644 --- a/src/Horse.Provider.Abstract.pas +++ b/src/Horse.Provider.Abstract.pas @@ -1,7 +1,7 @@ unit Horse.Provider.Abstract; {$IF DEFINED(FPC)} -{$MODE DELPHI}{$H+} + {$MODE DELPHI}{$H+} {$ENDIF} interface diff --git a/src/Horse.Provider.Console.pas b/src/Horse.Provider.Console.pas index c14aad2..57bc373 100644 --- a/src/Horse.Provider.Console.pas +++ b/src/Horse.Provider.Console.pas @@ -329,6 +329,9 @@ class procedure THorseProvider.SetPort(const AValue: Integer); if FEvent <> nil then FreeAndNil(FEvent); end; + +initialization + THorseProvider.SetKeepConnectionAlive(True); {$ENDIF} end. diff --git a/src/Horse.Provider.Daemon.pas b/src/Horse.Provider.Daemon.pas index 0a701b9..ba8931f 100644 --- a/src/Horse.Provider.Daemon.pas +++ b/src/Horse.Provider.Daemon.pas @@ -362,6 +362,9 @@ class procedure THorseProvider.SetPort(const AValue: Integer); begin FreeAndNil(FIdHTTPWebBrokerBridge); end; + +initialization + THorseProvider.SetKeepConnectionAlive(True); {$ENDIF} end. diff --git a/src/Horse.Provider.VCL.pas b/src/Horse.Provider.VCL.pas index 9cadc3b..3c4fb6c 100644 --- a/src/Horse.Provider.VCL.pas +++ b/src/Horse.Provider.VCL.pas @@ -306,6 +306,9 @@ class procedure THorseProvider.SetPort(const AValue: Integer); if FEvent <> nil then FreeAndNil(FEvent); end; + +initialization + THorseProvider.SetKeepConnectionAlive(True); {$ENDIF} end.