[Gambas-user] HttpClient question
Benoît Minisini
gambas at ...1...
Wed Mar 30 17:25:19 CEST 2011
> It seems that if you call HttpClient twice after each other with
> different urls in async mode, like in example below the _finished event
> is only called once (with the last call/url)
>
> So they are not really async/background, or is this a bug?
> Or are they overwritten, due to false usage/code?
>
> This happens in Gambas2 and 3...
>
> ' Gambas module
>
> Public hPachubeFetch As HttpClient
>
> Public Sub Main()
>
> Dim rFeeds As String[] = ["21017", "3711"]
> Dim sUrl, sFeed As String
>
> For Each sFeed In rFeeds
> Debug sfeed
> hPachubeFetch = New HttpClient As "hPachubeFetch"
> hPachubeFetch.URL = sUrl
> hPachubeFetch.TimeOut = 8
> hPachubeFetch.Tag = sFeed & "|0|12" ' feed | datastream | device id
> hPachubeFetch.Auth = 1
> hPachubeFetch.User = "user"
> hPachubeFetch.Password = "password"
> hPachubeFetch.Async = True
> hPachubeFetch.Get()
> Next
>
> End
>
> Public Sub hPachubeFetch_Finished()
>
> 'do stuff
>
> End
>
> Regards,
> Ron_2nd.
>
Hi,
In revision #3708, I have committed a change so that asynchronous HttpClient
object are automatically kept alive until they are finished.
So that previous code should work as expected now. Can you test that for me
please?
Thanks in advance.
Regards,
--
Benoît Minisini
More information about the User
mailing list