/**
* @param charsetName The charset used to convert between Java Unicode Strings and byte encodings
*/
public void requestExecCommand(Channel c, String cmd, String charsetName) 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(charsetName));
}
log.debug("Executing command (channel " + c.localID + ", '" + cmd + "')");
try