void ProcessRequestOrInput (IInputChannel input)
{
while (true) {
if (!loop)
return;
if (receive_synchronously) {
Message msg;
if (input.TryReceive (receive_timeout, out msg))
ProcessInput (input, msg);
} else {
input.BeginTryReceive (receive_timeout, TryReceiveDone, input);
loop_handle.WaitOne (receive_timeout);
}
}
}