Hi,
For some reason, I always get the error Message="The operation has timed out." everytime I send out the request to the host and the error is at count = resStream.Read(buf, 0, buf.Length); , Does anyone knows why and how do I solve this problem? Thanks
byte[] buf = new byte[8192];
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(sUrl);HttpWebResponse response = (HttpWebResponse)request.GetResponse();Stream resStream = response.GetResponseStream();
do
{
count = resStream.Read(buf, 0, buf.Length); //Error right here "The operation has timed out"
......
}
System.Net.WebException was unhandled by user code
Message="The operation has timed out."
Source="System"
StackTrace:
at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at FinalProcess.PostRegRequest(HttpResponse res, String sUrl) in d:\WebMap7.3\FinalProcess.aspx.cs:line 371
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)