void IHttpSocketAdapter.SetResponseHandler(ResponseHandler handler)
        {
            AssertWithMessage.Null(_responseHandler, "SetResponseHandler was called more than once.");
            AssertWithMessage.NotNull(handler, "SetResponseHandler was called with a null handler.");

            _responseHandler = handler;
        }
        public void SendResponseBodyContent(string content, Encoding encoding)
        {
            AssertWithMessage.NotNull(_responseHandler, "No response handler was set.");

            byte[] bytes = encoding.GetBytes(content);

            _responseHandler.Invoke(bytes, 0, bytes.Length);
        }