[Mono-dev] After two tried I get a System.Net.WebException: The request timed out

Carlos Solorzano carlos at applianz.com
Tue May 2 17:24:48 EDT 2006


Can someone else confirm this with me, I have an infinite loop calling a 
webpage (google is there just for you guys but I was calling a server 
internal to my network). On windows it runs fine but on mono I get a 
timeout after the second try. I have 1.1.10.1

using System;

namespace ConsoleApplication4
{
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    class Class1
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            int i = 0;
            while(true)
            {

                try
                {
                    
System.Net.WebRequest.Create("http://google.com").GetResponse().GetResponseStream().ReadByte();
                    Console.WriteLine("new conn " + (i++)  );
                }
                catch(Exception ex)
                {
                    Console.WriteLine("ERROR: " + ex);
                }
                System.Threading.Thread.Sleep(1000);
            }
        }
    }
}

#mono ConsoleApplication4.exe
new conn 0
new conn 1
ERROR: System.Net.WebException: The request timed out
in <0x00147> System.Net.HttpWebRequest:EndGetResponse (IAsyncResult 
asyncResult)
in <0x00047> System.Net.HttpWebRequest:GetResponse ()
in <0x00033> ConsoleApplication4.Class1:Main (System.String[] args)




More information about the Mono-devel-list mailing list