Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

HTTP Library

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-12-2008, 04:07 AM
Junior Member
 
Join Date: Mar 2008
Posts: 33
Default HTTP Library

I don't know if I am doing something wrong with the HTTP Library but this code


Code:
Sub Getfound()


    wwwreq2.New1(
"http://www.geocaching.com/my/")
    wwwreq2.TimeOut=
120000
    wwwreq2.AddHeader(
"Cookie",GC_Session_ID&" "&GC_user_id)
    
Msgbox(wwwreq2.Headers)
    wwwres2.Value = wwwreq2.GetResponse

    tmp=wwwres2.GetString
    Textbox1.Text=tmp
    
regex.New1("Caches Found: [0-9]+")
    match.Value=
regex.Match(tmp)
    
    
Return SubString(match.String,13,StrLength(match.String))
End Sub
Works like a charm on the Desktop hangs on the "wwwres2.Value = wwwreq2.GetResponse" on my device

After I have logged onto the site I ask it to fetch the number of caches I have found. This is done my calling Geocaching - Login with the ASP.NET_SessionID set to the correct Cookie,

It seems that once I have connected to 2 URLS it the device hangs on the third call to GetResponse. Yes I have the current version of the HTTP Lib.

Any Ideas.

James

Last edited by bish0p : 09-12-2008 at 04:10 AM.
Reply With Quote
  #2 (permalink)  
Old 09-12-2008, 08:59 AM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 295
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Maybe you need to close the webresponse before starting a new one?
(just thinking out loud here)

-=edit=-
seems to a correct assumption, form the help file :
-----
Sub GetText (URL)
Response.New1
Request.New1(URL)
Response.Value = Request.GetResponse 'This line calls the server and gets the response.
string = Response.GetString 'Get the Response string.
Response.Close
return string
End Sub

Last edited by Mr_Gee : 09-12-2008 at 09:01 AM.
Reply With Quote
  #3 (permalink)  
Old 09-12-2008, 09:30 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by Mr_Gee View Post
Maybe you need to close the webresponse before starting a new one?
Well spotted Mr_Gee . From the book "Network Programming for the .NET Framework".
Quote:
should be closed ... if not called the application will leak resources and run out of allowed connections.
So even if not the root problem here definitely something that needs doing in any case.
Reply With Quote
  #4 (permalink)  
Old 09-12-2008, 01:17 PM
Junior Member
 
Join Date: Mar 2008
Posts: 33
Default

Yup that did it, I don't know how I missed that ...

Thanks
Reply With Quote
  #5 (permalink)  
Old 09-12-2008, 01:24 PM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 295
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by agraham View Post
Well spotted Mr_Gee .
thanks for the compliment agraham
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTTP library - SOAP action zdenkot Questions (Windows Mobile) 10 07-04-2009 03:19 PM
HTTP library v1.4 Erel Official Updates 2 10-29-2008 09:11 PM
HTTP and Referer Elrick Questions (Windows Mobile) 1 03-26-2008 12:43 PM
HTTP library v1.3 Erel Official Updates 1 03-15-2008 10:57 AM
HTTP library help agraham Bug Reports 1 01-07-2008 10:15 AM


All times are GMT. The time now is 02:17 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0