# HTTP SubClass Event Question

**URL:** <https://forum.xojo.com/t/http-subclass-event-question/14828>\
**Category:** General\
**Created:** [March 7, 2014, 8:03pm UTC](https://forum.xojo.com/t/http-subclass-event-question/14828 "2014-03-07T20:03:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 7, 2014, 8:03pm UTC](https://forum.xojo.com/t/http-subclass-event-question/14828/1 "2014-03-07T20:03:22Z")

</div>

Hello,

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.SetRequestContent(“Accept:”,“text/html,application/xhtml+xml,application/xml”)  
HTTPGetUpgradeFile.SetRequestContent(“Accept-Language:”,“en-US”)  
HTTPGetUpgradeFile.SetRequestHeader(“Accept-Encoding:”,“gzip,deflate,sdch”)  
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(“[http://www.syntheticdreams.org/calculator/IntelligentSubnetCalculator-1.1.3.app.tar.gz](http://www.syntheticdreams.org/calculator/IntelligentSubnetCalculator-1.1.3.app.tar.gz)”,SourceFolder,70)

I never get anything in the HTTP\_GetUpgradeFile.ReceiveProgress event. Am I doing something wrong?

Thank you.  
Mike

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [March 7, 2014, 9:09pm UTC](https://forum.xojo.com/t/http-subclass-event-question/14828/2 "2014-03-07T21:09:59Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![Mike\_Cotrone](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_cotrone/32/19940_2.png) [@Mike\_Cotrone](https://forum.xojo.com/u/Mike_Cotrone)\
**Post date:** [March 7, 2014, 9:58pm UTC](https://forum.xojo.com/t/http-subclass-event-question/14828/3 "2014-03-07T21:58:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:06pm UTC](https://forum.xojo.com/t/http-subclass-event-question/14828/4 "2020-10-29T17:06:45Z")

</div>


