private void DecomposeHttpRequest(HttpListenerRequest httpListenerRequest)
{
if (httpListenerRequest == null)
{
throw new ArgumentNullException("httpListenerRequest");
}
this.httpRequestUri = httpListenerRequest.Url;
this.httpRequestMethod = httpListenerRequest.HttpMethod;
try
{
Stream requestStream = httpListenerRequest.InputStream;
byte[] payloadBuffer = new byte[this.bufferSize];
int readSize = 0;
while (true)
{
int tempIndex = 0;
readSize = requestStream.Read(payloadBuffer, 0, payloadBuffer.Length);
if (readSize == 0)
{
break;
}
else
{
this.httpRequestPayload = DecodeMessage.GetBytes(payloadBuffer, ref tempIndex, readSize);
}
}
requestStream.Close();
}
catch (ObjectDisposedException e)
{
if (this.logger != null)
{
this.logger.AddWarning(
string.Format("Object disposed exception is catched, detailed information: {0}.", e.Message));
}
else
{
throw;
}
}
if (this.logger != null)
{
this.logger.AddDebug("Unmarshal PCHC request message is successfully.");
}
}