Hi all,

I have faced System.Net.HttpWebRequest problem in my developement.
My situation is like here:
I am using threading to retrieve data from server every 3 seconds. When I
failed to retrieve once from server, then the following retrieval also will
not successful anymore. Do anyone know how to solve the this kind of porblem?

My coding is like this:
Dim url as string = "http://lms.n2n.com" 'Example
Dim Req As System.Net.HttpWebRequest
Dim Resp As System.net.HttpWebResponse
Dim Uri As New Uri(url)

Req = System.Net.HttpWebRequest.CreateDefault(Uri)
Req.KeepAlive = False
Resp = Req.GetResponse
...

Everytime it will stuck in Req.GetResponse, then throw the error. Any one
have a good suggestion to solve it ?

Thanks a lot...

Re: Problem In System.Net.HttpWebRequest by Peter

Peter
Mon Mar 13 01:57:48 CST 2006

What specific error/exception is encountered?

Peter

--
Peter Foot
Windows Embedded MVP
www.peterfoot.net | www.inthehand.com

"keanhui" <keanhui@discussions.microsoft.com> wrote in message
news:D2709A99-D0DB-4C24-89F4-34C6D99B1DCE@microsoft.com...
> Hi all,
>
> I have faced System.Net.HttpWebRequest problem in my developement.
> My situation is like here:
> I am using threading to retrieve data from server every 3 seconds. When I
> failed to retrieve once from server, then the following retrieval also
> will
> not successful anymore. Do anyone know how to solve the this kind of
> porblem?
>
> My coding is like this:
> Dim url as string = "http://lms.n2n.com" 'Example
> Dim Req As System.Net.HttpWebRequest
> Dim Resp As System.net.HttpWebResponse
> Dim Uri As New Uri(url)
>
> Req = System.Net.HttpWebRequest.CreateDefault(Uri)
> Req.KeepAlive = False
> Resp = Req.GetResponse
> ...
>
> Everytime it will stuck in Req.GetResponse, then throw the error. Any one
> have a good suggestion to solve it ?
>
> Thanks a lot...
>
>



Re: Problem In System.Net.HttpWebRequest by keanhui

keanhui
Mon Mar 13 03:01:27 CST 2006

Because I have add Req.Timeout = 20000, so the error is "The Operation has
timed-out."


"Peter Foot [MVP]" wrote:

> What specific error/exception is encountered?
>
> Peter
>
> --
> Peter Foot
> Windows Embedded MVP
> www.peterfoot.net | www.inthehand.com
>
> "keanhui" <keanhui@discussions.microsoft.com> wrote in message
> news:D2709A99-D0DB-4C24-89F4-34C6D99B1DCE@microsoft.com...
> > Hi all,
> >
> > I have faced System.Net.HttpWebRequest problem in my developement.
> > My situation is like here:
> > I am using threading to retrieve data from server every 3 seconds. When I
> > failed to retrieve once from server, then the following retrieval also
> > will
> > not successful anymore. Do anyone know how to solve the this kind of
> > porblem?
> >
> > My coding is like this:
> > Dim url as string = "http://lms.n2n.com" 'Example
> > Dim Req As System.Net.HttpWebRequest
> > Dim Resp As System.net.HttpWebResponse
> > Dim Uri As New Uri(url)
> >
> > Req = System.Net.HttpWebRequest.CreateDefault(Uri)
> > Req.KeepAlive = False
> > Resp = Req.GetResponse
> > ...
> >
> > Everytime it will stuck in Req.GetResponse, then throw the error. Any one
> > have a good suggestion to solve it ?
> >
> > Thanks a lot...
> >
> >
>
>
>