Наследование: IDisposable
Пример #1
0
        /// <summary>
        /// Parse a HTTP header after sending it through the TCP channel
        /// </summary>
        /// <returns>A parsed version of <param>rq_line</param></returns>
        /// <remarks>
        /// This method must be called between Setup() and TearDown().
        /// </remarks>
        public static HttpRequestLine ParseHttpRequestLine(string rq_line)
        {
            byte[] to_send = System.Text.Encoding.ASCII.GetBytes(rq_line);

            var es = new EchoSocket(bUseIPv6, to_send);
            using (var hs = new HttpSocket(es.socket))
            {
                es.socket.Shutdown(SocketShutdown.Send);
                return new HttpRequestLine(hs);
            }
        }
Пример #2
0
        /// <summary>
        /// Parse a HTTP header after sending it through the TCP channel
        /// </summary>
        /// <returns>A parsed version of <param>header</param></returns>
        /// <remarks>
        /// This method must be called between Setup() and TearDown().
        /// </remarks>
        public static HttpHeaders ParseHttpHeaders(string header)
        {
            byte[] to_send = System.Text.Encoding.ASCII.GetBytes(header);

            var es = new EchoSocket(bUseIPv6, to_send);
            using (var hs = new HttpSocket(es.socket))
            {
                es.socket.Shutdown(SocketShutdown.Send);
                return new TrotiNet.HttpHeaders(hs);
            }
        }
Пример #3
0
        /// <summary>
        /// Parse a HTTP header after sending it through the TCP channel
        /// </summary>
        /// <returns>A parsed version of <param>rq_line</param></returns>
        /// <remarks>
        /// This method must be called between Setup() and TearDown().
        /// </remarks>
        static public HttpRequestLine ParseHttpRequestLine(string rq_line)
        {
            byte[] to_send = System.Text.Encoding.ASCII.GetBytes(rq_line);

            var es = new EchoSocket(bUseIPv6, to_send);

            using (var hs = new HttpSocket(es.socket))
            {
                es.socket.Shutdown(SocketShutdown.Send);
                return(new HttpRequestLine(hs));
            }
        }
Пример #4
0
        /// <summary>
        /// Parse a HTTP header after sending it through the TCP channel
        /// </summary>
        /// <returns>A parsed version of <param>header</param></returns>
        /// <remarks>
        /// This method must be called between Setup() and TearDown().
        /// </remarks>
        static public HttpHeaders ParseHttpHeaders(string header)
        {
            byte[] to_send = System.Text.Encoding.ASCII.GetBytes(header);

            var es = new EchoSocket(bUseIPv6, to_send);

            using (var hs = new HttpSocket(es.socket))
            {
                es.socket.Shutdown(SocketShutdown.Send);
                return(new TrotiNet.HttpHeaders(hs));
            }
        }