Timeout in HttpWebRequest.GetRequestStream

  • Thread starter Thread starter Bogdan Sima
  • Start date Start date
B

Bogdan Sima

Hello,

I use HttpWebRequest.GetRequestStream to post some data from a PocketPC to a
WEB page. Sometimes, totally inconsistent, the call times out. At the same
time the call from a device times out, some other devices are able to post.
Then it's other device's turn to time out, while the one that originally
timed out works fine. Same behavior can be observed on different PocketPC
devices using different wireless networks and even in the emulator.

Any ideas?

Thank you!
 
Hi,

it might not be of much help but I have exactly the same problem. Have
a look at a past thread :
http://groups.google.com/groups?hl=...m=e#[email protected]#link1
.. Basically I can use the GetRequestStream twice but the third time
that I want to upload a file to a server it just gets stuck at that
line. So far haven't been able to solve the bug. I used the following
code from the following website for the upload/download methods :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/httpcomm.asp
.. Are you using the same code ?

I'll be following this thread very closely.. maybe someone else has
got a way to upload/download files to/from a webserver.

jez
 
Yes, I'm using about the same code. I tried to increase the ResponseTimeout
with no effect. The operation, when successfull, takes less than a second
anyway.

This is going to be my second day trying to fix this issue ...

Later.
 
Are you closing streams you get with GetRequestStream() and GetResponseStream()? You should close them as soon as you finish writing/reading.

Marian
 
I have the same problem. GetRequestStream works fine forthe first and second time (2 sec) but the third time it timesout.
Did you find the solution.
Thanks
-Rafee
 
Anyone have an update on this? I think it is a problem with the
compact framework http libraries. I was doing some testing with
netstat on my e800 and found that the TCP sockets were left in a
CLOSE_WAIT state. This only happens when I connect to certain
sites(like to a tomcat 5x server for example). Other sites like
Yahoo works fine.

Allen
 
yes, I had this exact problem. Make sure you close all Requests. I was
reading the response but not closing it.

Dim res As System.Net.WebResponse = wr.GetResponse()
....
res.Close() '''THIS FIXED my problem!
 
Back
Top