[Gambas-user] HTTPClient freeze after 40 mins with Gambas 3.18.4
Fabien Bodard
gambas.fr at gmail.com
Sat Sep 30 11:12:37 CEST 2023
Hi Christopher,
Can you try to change your get function
Like This :
Public Function Get(sUrl as String) As String
Dim sBuffer As String
If sUrl Then
$H = New HttpClient As "HClient"
$H.Url = sUrl
$H.Async = False
$H.Timeout = 600
$H.Get
' Success - read the data
If Lof($H) Then sBuffer = Read #$H, Lof($H)
If $H.Code 299 Then
Error.Raise("Degapp Fehler – Code " & $H.Code & " " & sBuffer)
Endif
If $H.Status < 0 Then
Error.Raise("Connection zu Degapp kaputt. Curl Status (" &
$H.Status & ") kleiner 0.")
Else
$H.Close
Return sBuffer
End If
Else
Error.Raise("Der Pfad für Degapp ist nicht definiert.")
Endif
Wait
End
In This case any call to get generate a new HttpClient and a Wait call
You have to pass the required Url to the function or use a private variable
To Set the Url at the Client Creation. I want you to try that please to be
sure that you not have any call to the Get function without instanciate a
new Client.
As you wish.
Best regards,
Fabien Bodard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230930/c536e9e4/attachment.htm>
More information about the User
mailing list