code: public boolean sendRequest(String requesttype, boolean wantreply,
  			byte[] requestdata, boolean isActivity) throws SshException {
  
  		synchronized (this) {
  			ByteArrayWriter msg = new ByteArrayWriter();
  			try {
  				msg.write(SSH_MSG_CHANNEL_REQUEST);
  				msg.writeInt(remoteid);
  				msg.writeString(requesttype);
  				msg.writeBoolean(wantreply);
  				if (requestdata != null) {
  					msg.write(requestdata);
  
  				}
  
  				if (Log.isDebugEnabled()) {
  					Log.debug(this,
  							"Sending SSH_MSG_CHANNEL_REQUEST id=" + channelid
  									+ " rid=" + remoteid + " request="
  									+ requesttype + " wantreply=" + wantreply);
  				}
  				connection.sendMessage(msg.toByteArray(), true);
  
  				boolean result = false;
  
  				if (wantreply) {
  					SshMessage reply = processMessages(CHANNEL_REQUEST_MESSAGES);
  					return reply.getMessageId() == SSH_MSG_CHANNEL_SUCCESS;
  				}
  
  				return result;
  
  			} catch (IOException ex) {
  				throw new SshException(ex, SshException.INTERNAL_ERROR);
  			} finally {
  				try {
  					msg.close();
  				} catch (IOException e) {
  				}
  			}
  		}
  
  	}
docs: Sends a channel request. Many channels have extensions that are specific
  to that particular channel type, an example of which is requesting a
  pseudo terminal from an interactive session.
  
  @param requesttype
  the name of the request, for example "pty-req"
  @param wantreply
  specifies whether the remote side should send a
  success/failure message
  @param requestdata
  the request data
  @param isActivity
  @return <code>true</code> if the request succeeded and wantreply=true,
  otherwise <code>false</code>
  @throws IOException