using System;
namespace AsterNET.FastAGI.Command
{
///
/// Receives a character of text on a channel.
/// Specify timeout to be the maximum time to wait for input in milliseconds, or 0 for infinite.
/// Most channels do not support the reception of text.
/// Returns the decimal value of the character if one is received, or 0 if the
/// channel does not support text reception. Returns -1 only on error/hangup.
///
public class ReceiveCharCommand : AGICommand
{
/// The milliseconds to wait for the channel to receive a character.
private int timeout;
///
/// Get/Set the milliseconds to wait for the channel to receive a character.
///
public int Timeout
{
get { return timeout; }
set { this.timeout = value; }
}
///
/// Creates a new ReceiveCharCommand with a default timeout of 0 meaning to wait for ever.
///
public ReceiveCharCommand()
{
this.timeout = 0;
}
///
/// Creates a new ReceiveCharCommand.
///
/// the milliseconds to wait for the channel to receive a character.
public ReceiveCharCommand(int timeout)
{
this.timeout = timeout;
}
public override string BuildCommand()
{
return "RECEIVE CHAR " + timeout;
}
}
}