Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello All,

I am facing a problem related to the HttpWebRequest's GetResponse API. In our application we are using HttpWebRequest-Response method to communicate with a device over WiFi.
The problem here is when we are sending a particular request to the device, the device takes approx. more than 1 minute time to provide the response. But meanwhile the device receives the same request again from the PC, which creates a problem.
Observation:
The timeout for the request is already set to 200000 milliseconds i.e.
httpDevRequest.Timeout = 200000;
and then the request was sent using the below statement:
httpDevResponse = (HttpWebResponse)httpDevRequest.GetResponse();
When the control reaches the above statement it waits for the response but when we look in wireshark/ethereal, we see that another duplicate request is sent to the device if device takes more than 1 minute to respond to the 1st request.

From this behavior we are guessing that somewhere the WebServer is re-sending the request to the device if it doesn't receive the response within 60 Secs.

does anyone had ever faced similar issue or anyone has any suggestion to fix this issues.
Note: Somewhere i had read that the default timeout for HttpRequest is 60 Secs. But the question here is i had already set the timeout to 200 seconds then how this default timeout is getting active?

Please help.
Thanks,
Dinesh
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900