コード例 #1
0
 /*
  * This constructor loads and http connection from a given tcp client.
  * It establishes the required streams and objects, then loads in the 
  * header information, it avoids loading in post data for efficeincy.
  * The post data gets loaded later on when the parameters are accessed.
  */
 internal HttpConnection(){
     _disposed = false;
     _parser = new HttpParser();
 }
コード例 #2
0
 internal void StartRequest(long id,string[] words,HttpConnection connection,ref HttpParser parser)
 {
     _id = id;
     _method = words[0].ToUpper();
     _path = words[1];
     _version = words[2];
     _mreParameters = new ManualResetEvent(false);
     _connection = connection;
     _contentBuffer = new MemoryStream();
     _requestTimeout = _requestStart.AddMilliseconds(int.MaxValue);
     _headers = new HeaderCollection();
     _requestStart = DateTime.Now;
     _parser = parser;
     _response = new HttpResponse(this);
     parser.RequestHeaderLineRecieved = _RequestHeaderLineReceived;
     parser.RequestHeaderComplete = _RequestHeaderComplete;
     parser.RequestBodyBytesRecieved = _RequestBodyBytesReceived;
     parser.RequestComplete = _RequestComplete;
 }