PDA

View Full Version : HTTP action progress


CWRIGHT
03-22-2004, 12:46 PM
Hi,

I am using the HTTP.TestConnection and HTTP.Submit actions to post data to a php script.

The actions have a timeout setting to wait for a response from the remote server, but is there any way to display to the user visually the status of this wait (if there is one)?

For example, if my server is down, the HTTP action will try to connect for 20 secs (by default). During that 20 seconds nothing happens in my AMS application -- it appears frozen, and that is a long time for an application to be frozen without so much as even an hourglass cursor. I would like to display to the user the progress of this 20 second wait (should it be necessary) but the status callback function is only available for HTTP.Download.

I have tried running a page OnTimer event, but even that pauses during the 20 seconds.

Any suggestions appreciated.

Thanks, CW

TJ_Tigger
03-22-2004, 01:30 PM
What about this. This is from the help guide but is for the HTTP.Download action
connected = HTTP.TestConnection("http://www.indigorose.com", 20, 80, nil, nil);

-- If they are connected.
if connected then
-- Download a file to their temporary directory.
StatusDlg.Show(MB_ICONNONE, false);
HTTP.Download("http://www.indigorose.com/setup.exe", _TempFolder.."\\setup.exe", MODE_BINARY, 20, 80, nil, nil, nil);

-- Get any error codes that may have been returned by the download action.
error = Application.GetLastError();
StatusDlg.Hide();

CWRIGHT
03-22-2004, 01:38 PM
Thanks Tigg, but unfortunately the same problem would be encountered with the example code.

If the user wasn't connected (first line of code) it takes the AMS application 20 seconds to tell you, without any status displayed on the screen. It appears to the user that your app has just frozen.

I know the 20 secs timeout can be lowered, but even at 10 seconds that's a long wait with nothing happening.

Thanks for the suggestion though.

CW

CWRIGHT
03-22-2004, 01:46 PM
Thanks, please ignore me.

I wasn't using the HTTP.TestConnection right. Problem solved.