SSH services (clients and servers) are implemented as channels
that are multiplexed over an SSH connection and communicates via
the
The functions init/1, terminate/2, handle_ssh_msg/2 and
handle_msg/2 are the functions that are required
to provide the implementation for a server side channel, such as
an SSH subsystem channel that can be plugged into the Erlang ssh
daemon see
Type definitions that are used more than once in this module and/or abstractions to indicate the intended use of the data type:
Makes a synchronous call to the channel process by sending
a message and waiting until a reply arrives or a timeout
occurs. The channel will call
Sends an asynchronous message to the channel process and
returns ok immediately, ignoring if the destination node or
channel process does not exist. The channel will call
Makes an existing process an
The following options must be present:
This function is normally not called by the
user. The user only needs to call if for some reason the
channel process needs to be started with help of
This function can be used by a channel to explicitly send a
reply to a client that called
Starts a processes that handles an SSH channel. It will be
called internally by the SSH daemon or explicitly by the SSH
client implementations. The behavior will set the
The timeout values that may be returned by the callback functions
has the same semantics as in a
This function is called by a client side channel when it
should update its internal state during a release
upgrade/downgrade, i.e. when the instruction
Soft upgrade according to the OTP release concept is not straight forward for the server side, as subsystem channel processes are spawned by the SSH application and hence added to its supervisor tree. It could be possible to upgrade the subsystem channels, when upgrading the user application, if the callback functions can handle two versions of the state, but this function can not be used in the normal way.
In the case of an upgrade,
The function should return the updated internal state.
Makes necessary initializations and returns the initial channel state if the initializations succeed.
For more detailed information on timeouts see the section
Handles messages sent by calling
For more detailed information on timeouts see the section
Handles messages sent by calling
For more detailed information on timeouts see the section
Handle other messages than ssh connection protocol, call or cast messages sent to the channel.
Possible erlang 'EXIT'-messages should be handled by this function and all channels should handle the following message.
Handles ssh connection protocol messages that may need service specific attention.
The following message is completely taken care of by the ssh channel behavior
This function is called by a channel process when it is
about to terminate. Before this function is called