private bool readRequest()
{
int left = header.ContentLength - header.DataString.Length;
int dataLen = 0;
if (left > 0)
{
byte[] data = new byte[left];
try
{
dataLen = stream.Read(data, 0, left);
if (dataLen == 0)
{
XmlRpcUtil.error("XmlRpcServerConnection::readRequest: Stream was closed");
return(false);
}
}
catch (Exception ex)
{
XmlRpcUtil.error("XmlRpcServerConnection::readRequest: error while reading the rest of data ({0}).", ex.Message);
return(false);
}
header.Append(Encoding.ASCII.GetString(data, 0, dataLen));
}
// Otherwise, parse and dispatch the request
XmlRpcUtil.log(XmlRpcUtil.XMLRPC_LOG_LEVEL.DEBUG, "XmlRpcServerConnection::readRequest read {0} bytes.", dataLen);
if (!header.ContentComplete)
{
return(false);
}
_connectionState = ServerConnectionState.WRITE_RESPONSE;
return(true); // Continue monitoring this source
}