hibri/HttpMock — pull request #9 by knocte (2012-11-22 10:27:43+00:00)
Title: HttpServer: Fix IsAvailable() to be able to return FALSE

If the method .Start() of HttpServer was not called, IsAvailable() was
throwing an exception instead of returning FALSE.

This change has the added benefit that makes HttpMock work when run
with Mono. Why? Because apparently the _thread.Start(); in Microsoft.NET
is so fast that IsAvailable always returned TRUE when queried AFTER the
server thread had already started Kayak. In Mono, this call must be slower
maybe because the secondary thread is given less priority, so then
IsAvailable was throwing the exception and not using the retrying loop
(that is already in place) properly.

(So this is not a Mono bug. When using multi-threading code, you should
never assume any certain speed of any thread.)