public void Stop()
		{
			if (_listener == null)
				return;
			_listener.Dispose ();
			_listener = null;
		}
		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 EventHttpRequest(EventHttpListener listener, IntPtr handle)
		{
			_listener = listener;
			_handle = new EvHttpRequest(handle);
			Method = Event.EvHttpRequestGetCommand(_handle).ToString().ToUpper();
			Uri = Marshal.PtrToStringAnsi(Event.EvHttpRequestGetUri(_handle));
			var pHost = Event.EvHttpRequestGetHost(_handle);
			if (pHost != IntPtr.Zero)
				Host = Marshal.PtrToStringAnsi(pHost);
			Headers = EvKeyValuePair.ExtractDictinary(Event.EvHttpRequestGetInputHeaders(_handle));

			var evBuffer = new EvBuffer(Event.EvHttpRequestGetInputBuffer(_handle), false);
			if (!evBuffer.IsInvalid)
			{
				var len = Event.EvBufferGetLength(evBuffer).ToInt32();
				RequestBody = new byte[len];
				Event.EvBufferRemove(evBuffer, RequestBody, new IntPtr(len));
			}

		}
		public void Start()
		{
			_listener = new EventHttpListener(RequestHandler);
			_listener.Start(_host, (ushort) _port);
		}