예제 #1
0
        public static HttpDatagram Parse(byte [] rawDgram)
        {
            if (rawDgram.Length <= 0)
            {
                return(null);
            }

            int headers_offset    = 0;
            HttpDatagramType type = DetectDatagramType(rawDgram, out headers_offset);

            if (type == HttpDatagramType.Unknown)
            {
                return(null);
            }

            HttpDatagram dgram = new HttpDatagram(type);

            if (ParseHeaders(dgram, rawDgram, headers_offset))
            {
                return(dgram);
            }

            return(null);
        }
예제 #2
0
 public HttpDatagram(HttpDatagramType type)
 {
     this.type = type;
 }
예제 #3
0
 public HttpDatagram (HttpDatagramType type)
 {
     Type = type;
 }
예제 #4
0
 public HttpDatagram(HttpDatagramType type)
 {
     Type = type;
 }
예제 #5
0
 public HttpDatagram(HttpDatagramType type)
 {
     this.type = type;
 }