libssh 0.7.5

Public Member Functions
ssh::Channel Class Reference

the ssh::Channel class describes the state of an SSH channel. More...

`#include <include/libssh/libsshpp.hpp>`

## Public Member Functions
Channel * | acceptX11 (int timeout_ms)
| accept an incoming X11 connection More...
void | changePtySize (int cols, int rows)
| change the size of a pseudoterminal More...
void | close ()
| closes a channel More...
bool | isClosed ()
| returns true if channel is in closed state More...
bool | isEof ()
| returns true if channel is in EOF state More...
bool | isOpen ()
| returns true if channel is in open state More...
int | write (const void *data, size_t len, bool is_stderr=false)
| Writes on a channel. More...

## Detailed Description

the ssh::Channel class describes the state of an SSH channel.

See also
  ssh_channel

## Member Function Documentation

## ◆ acceptX11()

Channel* ssh::Channel::acceptX11 | ( | int | timeout_ms | ) |
| inline

accept an incoming X11 connection

Parameters

  [in] | timeout_ms | timeout for waiting, in ms

Returns
  new Channel pointer on the X11 connection
  NULL in case of error

Warning
  you have to delete this pointer after use

See also
  ssh_channel_accept_x11
  Channel::requestX11

References ssh_channel_accept_x11().

## ◆ changePtySize()

void ssh::Channel::changePtySize | ( | int | cols,
|  | int | rows
| ) |  |
| inline

change the size of a pseudoterminal

Parameters

  [in] | cols | number of columns
  [in] | rows | number of rows

Exceptions

  SshException | on error

See also
  ssh_channel_change_pty_size

References ssh_channel_change_pty_size().

## ◆ close()

void ssh::Channel::close | ( |  | ) |
| inline

closes a channel

Exceptions

  SshException | on error

See also
  ssh_channel_close

References ssh_channel_close(), and ssh_channel_get_exit_status().

## ◆ isClosed()

bool ssh::Channel::isClosed | ( |  | ) |
| inline

returns true if channel is in closed state

See also
  ssh_channel_is_closed

References ssh_channel_is_closed().

## ◆ isEof()

bool ssh::Channel::isEof | ( |  | ) |
| inline

returns true if channel is in EOF state

See also
  ssh_channel_is_eof

References ssh_channel_is_eof().

## ◆ isOpen()

bool ssh::Channel::isOpen | ( |  | ) |
| inline

returns true if channel is in open state

See also
  ssh_channel_is_open

References ssh_channel_is_open(), ssh_channel_open_forward(), ssh_channel_open_session(), ssh_channel_poll(), ssh_channel_read_nonblocking(), ssh_channel_read_timeout(), ssh_channel_request_env(), ssh_channel_request_exec(), ssh_channel_request_pty(), ssh_channel_request_pty_size(), ssh_channel_request_send_signal(), ssh_channel_request_shell(), ssh_channel_request_subsystem(), ssh_channel_request_x11(), and ssh_channel_send_eof().

## ◆ write()

int ssh::Channel::write | ( | const void * | data,
|  | size_t | len,
|  | bool | is_stderr = `false`
| ) |  |
| inline

Writes on a channel.

Parameters

  data | data to write.
  len | number of bytes to write.
  is_stderr | write should be done on the stderr channel (server only)

Returns
  number of bytes written

Exceptions

  SshException | in case of error

See also
  channel_write
  channel_write_stderr

References ssh_channel_write(), and ssh_channel_write_stderr().

The documentation for this class was generated from the following file:

- include/libssh/libsshpp.hpp