[Gambas-user] HttpClient

Daniel Campos dcamposf at ...626...
Sun Jun 17 18:01:07 CEST 2007


Hi:

We'll you'd need to upgrade to 1.9.49 if you want to use the second
sollution, anyway with Gambas 1.0 you can use a trick, if you do not
want to manage events:

MyClient.Get()

DO WHILE MyClient.Status<>0

   WAIT 0.01

LOOP

IF MyClientStatus<0 THEN
    PRINT "ERROR"
ELSE
    ' READ DATA FROM MyClient
END IF

> I'm using Gambas 1.0.15 on Ubuntu. HttpClient doesn't have the Async or Timeout property. Do I need to upgrade?
>
> ----- Original Message ----
> From: Daniel Campos <dcamposf at ...626...>
> To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
> Sent: Sunday, 17 June, 2007 3:19:46 PM
> Subject: Re: [Gambas-user] HttpClient
>
> > > I'm wondering how to use HttpClient. I've written a function:
> > >
> > > PUBLIC SUB blah()
>
> HttpClient is asynchronous by default, so trying to read from the
> buffer after doing Get() has no sense (HTTP communications can delay
> some seconds in WAN). So, you have two options:
>
> 1) Wait for the Read event to get pieces of information as they arrive
> to the local system.
>
> 2) Put the "Async" property set to FALSE prior to Get(), that way
> Get() will stop the program flow until all the information is
> received. In that case you should use also the "TimeOut" property to
> set a timeout, if not, it could hang forvever if the server does not
> reply properly.
>
> Daniel
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
>
>
>
>
>       ___________________________________________________________
> Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
> now.
> http://uk.answers.yahoo.com/
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list