Android Question Web question

GaNdAlF89

Active Member
Licensed User
Longtime User
I have a problem with sockets, I send an http request but the server receive this request three times (from logs of server)...I'm sure that from my code the request is executed only once (from logs of my app). I considered to send the http request via browser and then intercept the response from browser. There is any way to do this?
 

GaNdAlF89

Active Member
Licensed User
Longtime User
It's a normal http request:

In main module:
B4X:
Sub Process_Globals
Dim Client As HttpClient
End Sub

Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
     Client.Initialize("Client")
End If
End Sub

Sub ButtonRequest_Click
GlobalModule.ExecuteRemoteQuery(query,2) 'query is a string with the script php and other parameters like "myscript.php?cmd= ..."
End Sub

In global module
B4X:
Sub ExecuteRemoteQuery(Query As String, TaskId As Int)
Dim Request As HttpRequest
Request.InitializeGet(serverAddress & Query)
Main.Client.Execute(Request,TaskId)
End Sub

Sorry, in the first post I forgot to say you that this happens when the server doesn't respond for some seconds (when it is overloaded). It is as if the socket automatically resend the request.
 
Last edited:
Upvote 0
Top