예제 #1
0
        public void AbortWhileGet()
        {
            // "System.Net.HttpListener Exception : The I/O operation has been aborted
            // because of either a thread exit or an application request
            //   at System.Net.HttpListener.GetContext()
            //   at MonoTests.System.Net.HttpListenerTest.CloseWhileGet()

            HttpListener listener = NetworkHelpers.CreateAndStartHttpListener("http://127.0.0.1:", out var _, "/abortwhileget/");
            RunMe        rm       = new RunMe(1000, new ThreadStart(listener.Abort), new object [0]);

            rm.Start();
            HttpListenerContext ctx = listener.GetContext();
        }
    public void CloseWhileGet ()
    {
        // "System.Net.HttpListener Exception : The I/O operation has been aborted
        // because of either a thread exit or an application request
        //   at System.Net.HttpListener.GetContext()
        //   at MonoTests.System.Net.HttpListenerTest.CloseWhileGet()

        HttpListener listener = new HttpListener ();
        listener.Prefixes.Add ("http://127.0.0.1:9001/closewhileget/");
        listener.Start ();
        RunMe rm = new RunMe (1000, new ThreadStart (listener.Close), new object [0]);
        rm.Start ();
        HttpListenerContext ctx = listener.GetContext ();
    }
예제 #3
0
		public void AbortWhileGet ()
		{
			// "System.Net.HttpListener Exception : The I/O operation has been aborted
			// because of either a thread exit or an application request
			//   at System.Net.HttpListener.GetContext()
			//   at MonoTests.System.Net.HttpListenerTest.CloseWhileGet()

			HttpListener listener = new HttpListener ();
			listener.Prefixes.Add ("http://127.0.0.1:9001/abortwhileget/");
			listener.Start ();
			RunMe rm = new RunMe (1000, new ThreadStart (listener.Abort), new object [0]);
			rm.Start ();
			HttpListenerContext ctx = listener.GetContext ();
		}