Bugzilla – Bug 322070
[XSP] Exception when stoping Mono.WebServer.ApplicationServer
Last modified: 2007-09-15 21:24:57 UTC
---- Reported by jfburdet@humanweb.ch 2006-09-11 14:33:53 MST ---- Description of Problem: XSP is launching Mono.WebServer.ApplicationServer, but when the thread is stopped, an ObjectDisposed exception is thrown from OnAccept (IAsyncResult ares) Steps to reproduce the problem: 1. Start XSP 2. Hit enter in the console to stop it Actual Results: - an exception is launced Expected Results: - XSP should stops quietly How often does this happen? - every time Additional Information: - I believe that that problem could be solved by adding a inner try/catch in the finally block because like : void OnAccept (IAsyncResult ares) { Socket accepted = null; try { accepted = listen_socket.EndAccept (ares); } catch { } finally { try { listen_socket.BeginAccept(accept_cb, null); } catch (ObjectDisposedException) { } } if (accepted == null) return; accepted.Blocking = true; SetSocketOptions (accepted); StartRequest (accepted, 0); } Since I'm not an expert, this should be confirmed by a Mono dev. ---- Additional Comments From gonzalo@ximian.com 2006-09-11 15:04:35 MST ---- Can you try with this change instead? Index: ApplicationServer.cs =================================================================== --- ApplicationServer.cs (revision 64953) +++ ApplicationServer.cs (working copy) @@ -329,7 +329,8 @@ accepted = listen_socket.EndAccept (ares); } catch { } finally { - listen_socket.BeginAccept (accept_cb, null); + if (started) + listen_socket.BeginAccept (accept_cb, null); } if (accepted == null) ---- Additional Comments From jfburdet@humanweb.ch 2006-09-11 15:19:02 MST ---- Hi Gonzalo, I tried your change, and it works : no exception (beside "1st chance exception" that can be seen only in the debugger) are thrown. ---- Additional Comments From gonzalo@ximian.com 2006-09-11 16:31:17 MST ---- Fixed in r65253. Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>XP SP2 / Visual Studio 2005</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".