From 357860b2cf3a5871e6ffddf52016ddf4d40d20ad Mon Sep 17 00:00:00 2001 From: inoussa Date: Tue, 26 Apr 2016 08:59:45 +0000 Subject: [PATCH] Synapse timeout (Thanks MVC). git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4631 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- wst/trunk/synapse_http_protocol.pas | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/wst/trunk/synapse_http_protocol.pas b/wst/trunk/synapse_http_protocol.pas index 0b6247762..4a2a36892 100644 --- a/wst/trunk/synapse_http_protocol.pas +++ b/wst/trunk/synapse_http_protocol.pas @@ -54,6 +54,8 @@ Type FFormat : string; FCookieManager : ICookieManager; private + function GetConnectTimeout : Integer; + function GetReadTimeout : Integer; function IndexOfHeader(const AHeader : string) :Integer; function GetAddress: string; function GetContentType: string; @@ -63,11 +65,13 @@ Type function GetProxyUsername: string; function GetSoapAction : string; procedure SetAddress(const AValue: string); + procedure SetConnectTimeout(AValue : Integer); procedure SetContentType(const AValue: string); procedure SetProxyPassword(const AValue: string); procedure SetProxyPort(const AValue: Integer); procedure SetProxyServer(const AValue: string); procedure SetProxyUsername(const AValue: string); + procedure SetReadTimeout(AValue : Integer); procedure SetSoapAction(const AValue : string); protected procedure DoSendAndReceive(ARequest,AResponse:TStream); override; @@ -85,6 +89,8 @@ Type property ProxyPassword : string read GetProxyPassword write SetProxyPassword; property SoapAction : string read GetSoapAction write SetSoapAction; property Format : string read FFormat write FFormat; + property ConnectTimeout: Integer read GetConnectTimeout write SetConnectTimeout; + property ReadTimeout: Integer read GetReadTimeout write SetReadTimeout; End; {$M+} @@ -99,6 +105,16 @@ const { THTTPTransport } +function THTTPTransport.GetConnectTimeout : Integer; +begin + Result := FConnection.Sock.ConnectionTimeout; +end; + +function THTTPTransport.GetReadTimeout : Integer; +begin + Result := FConnection.Timeout; +end; + function THTTPTransport.IndexOfHeader(const AHeader : string) : Integer; var i : Integer; @@ -165,6 +181,11 @@ begin FAddress := AValue; end; +procedure THTTPTransport.SetConnectTimeout(AValue : Integer); +begin + FConnection.Sock.ConnectionTimeout := AValue; +end; + procedure THTTPTransport.SetContentType(const AValue: string); begin FConnection.MimeType := AValue; @@ -190,6 +211,11 @@ begin FConnection.ProxyUser := AValue; end; +procedure THTTPTransport.SetReadTimeout(AValue : Integer); +begin + FConnection.Timeout := AValue; +end; + procedure THTTPTransport.SetSoapAction(const AValue : string); var i : Integer;