Works for me!

I created a new class (Class1) and set its super to httpsecuresocket

I added a constructor to class1 that calls super.constructor
Sub Constructor()
  Super.Constructor
End Sub

I added a doit method that calls get("http://www.google.com";)
Sub DoIt()
  get("http://www.google.com";)
End Sub

then I added some code to the Page Received event:
Sub PageReceived(url as string, httpStatus as integer, headers as internetHeaders, content as string)
  msgbox content
End Sub

and finally in the app.open event
Sub Open()
  dim http As new Class1()
  http.DoIt()
End Sub

Now, that fact that this works kinda surprises me ...
I actually expected http to go out of scope right after doit had been called. At which point I would expect the socket to be destroyed (possibly before fetching any data and perhaps even firing a 102 error). Not sure why it worked, maybe someone from RS could jump in with an answer there.

However, if you performed a synchronous get, that would be a different story:
Sub Open()
  dim http As new Class1()
  msgbox http.get("http://www.google.com";, 30)
End Sub

The socket wouldn't return from the get method call until it had finished fetching the page, and then wouldn't exit the open event until it was done.

At any rate, both seemed to work fine for me.

-jason


On Apr 7, 2006, at 12:44 PM, Guyren Howe wrote:

On Apr 7, 2006, at 2:25 AM, Guyren Howe wrote:

On Apr 7, 2006, at 1:56 AM, Guyren Howe wrote:

I create a HTTPSocket subclass, I ask it to get an address, it works fine.

I change its super to HTTPSecureSocket, I add the following constructor:

Me.Secure = False
Super.Constructor

and I ask it to get the same address, it eventually fails with a 103 error (which the TCPSocket docs say is a DNS failure).

I can't find a bug report on this. Anyone have any advice?

Oh, and this is 2K6r1 on OS X.

On Apr 7, 2006, at 12:35 PM, Jason Essington wrote:
Maybe a little more information would be useful ...

How are you using this socket? Is it instantiated in code, or is it a control on a window?

Could you post the code for your socket subclass? that would help also.

As I've said. I use HTTPSecureSocket as a subclass in our applications and it works just fine.

This is super-simple to reproduce:

Create new project. Add class. Set its super to HTTPSecureSocket.

Give it a DoIt Method:
        Me.Get "http://foo.com";.

Give it a PageReceived handler:
        MsgBox "Works"

Give it a Error handler:
        break

In App.Open, do:
        Dim x As New Class1
        x.DoIt

Run. After five seconds or so, you'll get dropped into the Error handler, showing a 103 error.

Now, change the Super of Class1 to HTTPSocket, and run again. Success!

Guyren G Howe
guyren-at-relevantlogic.com
http://relevantlogic.com

REALbasic, PHP, Python programming
PostgreSQL, MySQL database design and consulting
Technical writing and training


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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to