Xojo Conferences
XDCMay2019MiamiUSA

Getting at HTTPSocket 'content' (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Canvas redraw...
Next thread: Re: REALbasic-NUG Digest #8965


RE: official stance on Windows compatibility and is it worth it?   -   Triola, Marc
  Getting at HTTPSocket 'content'   -   Mike Carter
   Re: Getting at HTTPSocket 'content'   -   Seth Willits

Getting at HTTPSocket 'content'
Date: 01.08.03 02:23 (Thu, 31 Jul 2003 18:23:23 -0700)
From: Mike Carter
Hey all.

I'm having a tough time striking the best balance between reusability
(losing out) and efficiency (currently in the lead).

All I want to do is have access to the 'content' which is in the
PageComplete method of an HTTPSocket that I've subclassed into a class
called MySocket.

From a window I call:

MySocket sock
sock.get "http://blah.blah.blah.com"

(and here I have to parse the result of the get.)

So far I've tried copying the 'content' parameter into a local
Property, but for some reason when I try to access that property later
it's blank.

Since i'd like to reuse the MySocket, I don't want to put
method-specific code in the subclass.

What is everyone doing to get at the content returned from a HTTPSocket
Get?

Thanks.

#mikec

---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Re: Getting at HTTPSocket 'content'
Date: 01.08.03 08:05 (Fri, 1 Aug 2003 00:05:32 -0700)
From: Seth Willits
> All I want to do is have access to the 'content' which is in the
> PageComplete method of an HTTPSocket that I've subclassed into a class
> called MySocket.
>
> From a window I call:
>
> MySocket sock
> sock.get "http://blah.blah.blah.com"
>
> (and here I have to parse the result of the get.)
>
> So far I've tried copying the 'content' parameter into a local
> Property, but for some reason when I try to access that property later
> it's blank.

Sockets are Asynchronous, and by that it means that the getting the
webpage will happen in its own thread (essentially). How does this
affect you? It means that on the line after sock.get you are NOT
guaranteed to have received the page. What you should be doing is
parsing the result of the get from the PageReceived event.


Seth Willits
------------------------------------------------------------------------
---
President and Head Developer of Freak Software - http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine -
http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames

"Lots of folks confuse bad management with destiny."
-- Kim Hubbard
------------------------------------------------------------------------
---

---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>