HTTP SubClass Event Question


I have created a subclass of the HTTPSocket using a new class in the IDE (new HTTPSocket Subclass called HTTP_GetUpgradeFile).

I implemented the ReceiveProgress event on HTTP_GetUpgradeFile and put a simple msgbox in that event to pop to ensure that the event was being used.

For my SubClass Code Instantiation and execution this is working for me. The problem is that I am trying to update a progress bar integer variable with a “percent complete” and I can’t seem to get anything out of my HTTP_GetUpgradeFile subclass.

I then used this code In A Method to instantiate my new HTTPSocket Subclass called HTTP_GetUpgradeFile.

HTTPGetUpgradeFile = New HTTP_GetUpgradeFile
HTTPGetUpgradeFile.SetRequestHeader(“User-Agent:”,“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36”)

AutoIntall_DownloadStatus = HTTPGetUpgradeFile.Get(“”,SourceFolder,70)

I never get anything in the HTTP_GetUpgradeFile.ReceiveProgress event. Am I doing something wrong?

Thank you.

If you specify a Timeout in the call, the command becomes synchronous, so it just returns the data without firing any events. The solution is to just call Get( url ), implement the events, and use a Timer (or something) to handle the timeout yourself.

Take a look at the LR under HTTPSocket.Get.

Awesome thanks Kem! I missed that Sync doesn’t fire events. THank you for pointing it out!!! :slight_smile: