public void TestServerListening() { using ( var server = new EventHttpListener(r => r.Respond(System.Net.HttpStatusCode.OK, new Dictionary<string, string>(), new byte[0]))) { server.Start("127.0.0.1", _freePort); var wc = new WebClient(); wc.DownloadData(_urlBase); } CheckPortIsStillFree(); }
public void Start() { _listener = new EventHttpListener(RequestHandler); _listener.Start(_host, (ushort) _port); }