B4J Question httpjob response : Connection Refused

tufanv

Expert
Licensed User
Longtime User
Hello,

My server uses 2 seconds updates with a get method from a data feeding network to get the latest finance data and send to my own server's database with a timer that executes httpjob. It was working without problem but yesterday evening it took a "Connection refused" Error and did not send the updates to my own server till that moment. I have killed the process and restarted and it started working again. ( The app was not closed or crashed at the server side , it was still working but not sending updates ) I had try / catch in the code .

My question is , how can i make the app continue if it gets a conneciton refused response. ?

For Example Currently on jobdone I have:

TRy
...
Catch
log(lastexception.message)
end try

If i put httpjob.download ( get method ) between catch and end try , in case of a connection refuse message, will it continue with the next try . Because currently the app logged the error and stopped operations but not crashed.
 
Last edited:

tufanv

Expert
Licensed User
Longtime User
There is no error to catch here. You need to check whether Job.Success is true in JobDone event.
My httpjob initalizes every second with a timer. , if it was a success=false for one try , why didn't it continue with the next try with the timer ? Also the app did not crash but i had to restart to make the app get data from remote network again.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Check your code. The fact that a HttpJob fails doesn't affect any other requests.
I have talked with the network admin . He said that the reason for connection refused for my server's request was http get was requested without the header information which includes the login credentials but I always send the httpjob with username and password. Is it possible ?
 
Upvote 0
Top