Avatar of palloquin
palloquin
 asked on

webrequest timeouts at 3rd request

I'm trying to build a Window Mobile tool that posts data back to my server at intervals.

I'm using this code to do the posting (or getting... technically speaking...)

    Function postData(ByVal strData As String)
            Dim URL As String = "http://myurl.com/myfile.asp?data=" & strData
            Dim web As WebRequest
            web = WebRequest.Create(URL)
            web.Timeout = 5000
            web.GetResponse()
            web = Nothing
    End Function

I call the postData function from a timer every 30 seconds...

the first 2 posts, everything get through just fine, de third time (and everytime after) I get timeout errors...
restarting the app gives me another 2 posts.. and then... errors...

Any clues on how I could solve this?

P.s. Writing in vb.net on a WM6 HTC TYTN II using VS 2008 / CF 3.5
Smartphone Programming.NET ProgrammingVisual Basic.NET

Avatar of undefined
Last Comment
palloquin

8/22/2022 - Mon
palloquin

ASKER
please help me... If more info is needed, i'll post it...
alexey_gusev

I've seen somewhere on MSN that IIS can hang after 2-3 POST or PUT requests, maybe that's the case? have you tried different sites or maybe different servers?
palloquin

ASKER
Alexey, good thought, not it though...

I've rewritten my project to do this, and only this:

   Dim web As HttpWebRequest
            Dim URL As String

            URL = "http://www.cnn.com"
            web = HttpWebRequest.Create(URL)
            web.Timeout = 2500
            web.GetResponse()


            URL = "http://www.abc.com"
            web = HttpWebRequest.Create(URL)
            web.Timeout = 2500
            web.GetResponse()


            URL = "http://www.fox.com"
            web = HttpWebRequest.Create(URL)
            web.Timeout = 2500
            web.GetResponse()

            web = Nothing

again, first to request go fine, the third fails...
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER CERTIFIED SOLUTION
palloquin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.