On Mar 23, 2006, at 8:20 PM, Jerry Fritschle wrote:

When I try to add a timeout period to an httpsocket, I get "this method requires fewer parameters than were passed." The syntax I'm using (in a method in a httpsocket subclass) is

me.get url, 7

Tried it with parentheses, too. In both cases it works fine without the integer parameter.

There are two different ways to use the HTTPSocket. The first access the data and store it directly into a string:

Dim s As String = HTTPSocket1.Get("http://www.realsoftware.com";, 10)

Notice that while the above uses a timeout, it is returning the value to a string. This is the primary difference. So all you need to do to get your above code to work is:

    Me.Get url

That is it... notice that it is not returning the value to anything.

This second method uses the events in the HTTPSocket... and a time out period is not necessary since an Error event will fire as soon as possible if the server does not respond. In all my working with HTTPSocket, I have never actually seen a server connect and then stop responding although I know that it is possible. In my projects I do have a Timer connected to the HTTPSocket to force the timeout in this rare occurrence, but like I said I have never actually seen this error occur in one of my projects.


_______________________________________________
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