상속: 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));
            }
        }