}
}
public void requestExecCommand(Channel c, String cmd) throws IOException
{
PacketSessionExecCommand sm;
synchronized (c)
{
if (c.state != Channel.STATE_OPEN)
throw new IOException("Cannot execute command on this channel (" + c.getReasonClosed() + ")");
sm = new PacketSessionExecCommand(c.remoteID, true, cmd);
c.successCounter = c.failedCounter = 0;
}
synchronized (c.channelSendLock)
{
if (c.closeMessageSent)
throw new IOException("Cannot execute command on this channel (" + c.getReasonClosed() + ")");
tm.sendMessage(sm.getPayload());
}
if (log.isEnabled())
log.log(50, "Executing command (channel " + c.localID + ", '" + cmd + "')");