Esempio n. 1
0
 private void conn_DataReceived(TcpClientConnection<HttpConnectionState> conn, HttpConnectionState state, BufferData data)
 {
     HttpResponseParser parser = state.ResponseParser;
     string response = parser.Parse(data);//info:noexception
     if (response == null) return;
     conn.Close();//info:noexception
     TriggerCompleted(new HttpFetchResult(state.Url, response: response));
 }
 //info:noexception
 public string Parse(BufferData data)
 {
     if (data == null || data.Length == 0) return null;
     int count = _decoder.GetChars(data.Buffer, data.Offset, data.Length, _charbuffers, _count);
     _count += count;
     if (ParseEnd())
         return GetResult();
     return null;
 }