From c2ca477c85e0e88732f634ddfb01ac675a97dddb Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Thu, 26 Apr 2018 13:43:45 +0200 Subject: ssh: ssh_channel replaced by ssh_client_channel --- lib/ssh/doc/src/Makefile | 3 +- lib/ssh/doc/src/introduction.xml | 2 +- lib/ssh/doc/src/ref_man.xml | 3 +- lib/ssh/doc/src/specs.xml | 3 +- lib/ssh/doc/src/ssh.xml | 2 +- lib/ssh/doc/src/ssh_channel.xml | 434 -------------------------------- lib/ssh/doc/src/ssh_client_channel.xml | 440 +++++++++++++++++++++++++++++++++ lib/ssh/doc/src/ssh_connection.xml | 16 +- lib/ssh/doc/src/ssh_daemon_channel.xml | 52 ---- lib/ssh/doc/src/ssh_protocol.xml | 2 +- lib/ssh/doc/src/ssh_server_channel.xml | 2 +- lib/ssh/doc/src/using_ssh.xml | 2 +- 12 files changed, 456 insertions(+), 505 deletions(-) delete mode 100644 lib/ssh/doc/src/ssh_channel.xml create mode 100644 lib/ssh/doc/src/ssh_client_channel.xml delete mode 100644 lib/ssh/doc/src/ssh_daemon_channel.xml (limited to 'lib/ssh/doc') diff --git a/lib/ssh/doc/src/Makefile b/lib/ssh/doc/src/Makefile index 9b5bee34fa..7c4dbd7af8 100644 --- a/lib/ssh/doc/src/Makefile +++ b/lib/ssh/doc/src/Makefile @@ -40,10 +40,9 @@ RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN) XML_APPLICATION_FILES = ref_man.xml XML_REF3_FILES = \ ssh.xml \ - ssh_channel.xml \ + ssh_client_channel.xml \ ssh_client_key_api.xml \ ssh_connection.xml \ - ssh_daemon_channel.xml \ ssh_server_channel.xml \ ssh_server_key_api.xml \ ssh_sftp.xml \ diff --git a/lib/ssh/doc/src/introduction.xml b/lib/ssh/doc/src/introduction.xml index b7a73e2597..6fd8425adf 100644 --- a/lib/ssh/doc/src/introduction.xml +++ b/lib/ssh/doc/src/introduction.xml @@ -145,7 +145,7 @@ data that can be sent to the channel peer without adjusting the window. Typically, an SSH client opens a channel, sends data (commands), receives data (control information), and then closes the channel. - The ssh_channel behaviour + The ssh_client_channel behaviour handles generic parts of SSH channel management. This makes it easy to write your own SSH client/server processes that use flow-control and thus opens for more focus on the application logic. diff --git a/lib/ssh/doc/src/ref_man.xml b/lib/ssh/doc/src/ref_man.xml index 3351699c66..76e6520f94 100644 --- a/lib/ssh/doc/src/ref_man.xml +++ b/lib/ssh/doc/src/ref_man.xml @@ -35,9 +35,8 @@ - + - diff --git a/lib/ssh/doc/src/specs.xml b/lib/ssh/doc/src/specs.xml index 15e76cb5fa..acdbe2ddfd 100644 --- a/lib/ssh/doc/src/specs.xml +++ b/lib/ssh/doc/src/specs.xml @@ -1,10 +1,9 @@ - + - diff --git a/lib/ssh/doc/src/ssh.xml b/lib/ssh/doc/src/ssh.xml index da122b6081..0223831cb1 100644 --- a/lib/ssh/doc/src/ssh.xml +++ b/lib/ssh/doc/src/ssh.xml @@ -68,7 +68,7 @@ ssh_sftp:start_channel/1,2,3.

To write your own client channel handler, use the behaviour - ssh_channel. For server channel handlers use + ssh_client_channel. For server channel handlers use ssh_server_channel behaviour (replaces ssh_daemon_channel).

Both clients and daemons accepts options that controls the exact behaviour. Some options are common to both. diff --git a/lib/ssh/doc/src/ssh_channel.xml b/lib/ssh/doc/src/ssh_channel.xml deleted file mode 100644 index 63a480d747..0000000000 --- a/lib/ssh/doc/src/ssh_channel.xml +++ /dev/null @@ -1,434 +0,0 @@ - - - - -

- - 2009 - 2016 - Ericsson AB, All Rights Reserved - - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - The Initial Developer of the Original Code is Ericsson AB. - - ssh_channel - - - - -
- ssh_channel - -behaviour(ssh_channel). - - -

SSH services (clients and servers) are implemented as channels - that are multiplexed over an SSH connection and communicates over - the SSH - Connection Protocol. This module provides a callback API - that takes care of generic channel aspects for clients, such as flow control - and close messages. It lets the callback functions take care of - the service (application) specific parts. This behavior also ensures - that the channel process honors the principal of an OTP-process so - that it can be part of a supervisor tree. This is a requirement of - channel processes implementing a subsystem that will be added to - the ssh applications supervisor tree. -

- -

When implementing a ssh subsystem for daemons, use - -behaviour(ssh_server_channel) (Replaces ssh_daemon_channel) - instead. -

-
- - -

Functions in this module are not supposed to be called outside a module implementing this - behaviour! -

-
- -
- - - - call(ChannelRef, Msg) -> - call(ChannelRef, Msg, Timeout) -> Reply | {error, Reason} - Makes a synchronous call to a channel. - - ChannelRef = pid() - As returned by start_link/4 - Msg = term() - Timeout = timeout() - Reply = term() - Reason = closed | timeout - - - -

Makes a synchronous call to the channel process by sending - a message and waiting until a reply arrives, or a time-out - occurs. The channel calls Module:handle_call/3 - to handle the message. If the channel process does not exist, - {error, closed} is returned. -

-
-
- - - cast(ChannelRef, Msg) -> ok - Sends an asynchronous message to the channel - ChannelRef and returns ok. - - ChannelRef = pid() - As returned by start_link/4 - Msg = term() - - -

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 calls - Module:handle_cast/2 - to handle the message. -

-
-
- - - enter_loop(State) -> _ - Makes an existing process an ssh_channel process. - - State = term() - as returned by init/1 - - -

Makes an existing process an ssh_channel - process. Does not return, instead the calling process - enters the ssh_channel process receive loop and become an - ssh_channel process. The process must have been started using - one of the start functions in proc_lib, see the proc_lib(3) manual page in STDLIB. - The user is responsible for any initialization of the process - and must call init/1. -

-
-
- - - init(Options) -> {ok, State} | {ok, State, Timeout} | {stop, Reason} - Initiates an ssh_channel process. - - Options = [{Option, Value}] - State = term() - Timeout = timeout() - Reason = term() - - -

- The following options must be present: -

- - {channel_cb, atom()} -

The module that implements the channel behaviour.

- - {init_args(), list()} -

The list of arguments to the init function of the callback module.

- - {cm, ssh:connection_ref()} -

Reference to the ssh connection as returned by - ssh:connect/3. -

- - {channel_id, ssh:channel_id()} -

Id of the ssh channel as returned by - ssh_connection:session_channel/2,4. -

- -
- -

This function is normally not called by the - user. The user only needs to call if the - channel process needs to be started with help of - proc_lib instead of calling - start/4 or - start_link/4.

-
-
-
- - - reply(Client, Reply) -> _ - Sends a reply to a client. - - Client = opaque() - Reply = term() - - -

This function can be used by a channel to send a - reply to a client that called call/[2,3] when the reply - cannot be defined in the return value of - Module:handle_call/3.

-

Client must be the From argument provided to - the callback function handle_call/3. - Reply is an arbitrary term, - which is given back to the client as the return value of - call/[2,3].

-
-
- - - start(SshConnection, ChannelId, ChannelCb, CbInitArgs) -> - start_link(SshConnection, ChannelId, ChannelCb, CbInitArgs) -> - {ok, ChannelRef} | {error, Reason} - Starts a process that handles an SSH channel. - - SshConnection = ssh:connection_ref() - As returned by ssh:connect/3 - - ChannelId = ssh:channel_id() - As returned by - - ssh_connection:session_channel/[2,4]. - - ChannelCb = atom() - Name of the module implementing the service-specific parts - of the channel. - - CbInitArgs = [term()] - Argument list for the init function in the callback module. - - ChannelRef = pid() - - -

Starts a process that handles an SSH channel. It is - called internally, by the ssh daemon, or explicitly by the ssh - client implementations. The behavior sets the - trap_exit flag to true. -

-
-
- -
- -
- Callback Functions -

- The following functions are to be exported from a - ssh_channel callback module. -

- -
- Callback timeouts -

The timeout values that can be returned by the callback functions - have the same semantics as in a gen_server. - If the time-out occurs, handle_msg/2 - is called as handle_msg(timeout, State).

-
-
- - - - Module:code_change(OldVsn, State, Extra) -> {ok, - NewState} - Converts process state when code is changed. - - OldVsn = term() - In the case of an upgrade, OldVsn is Vsn, and - in the case of a downgrade, OldVsn is - {down,Vsn}. Vsn is defined by the vsn - attribute(s) of the old version of the callback module - Module. If no such attribute is defined, the version is - the checksum of the BEAM file. - State = term() - Internal state of the channel. - Extra = term() - Passed "as-is" from the {advanced,Extra} - part of the update instruction. - - -

Converts process state when code is changed.

- -

This function is called by a client-side channel when it - is to update its internal state during a release - upgrade or downgrade, that is, when the instruction - {update,Module,Change,...}, where - Change={advanced,Extra}, is given in the appup - file. For more information, refer to Section 9.11.6 - Release Handling Instructions in the - System Documentation. -

- -

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. The subsystem channels can - be upgraded when upgrading the user application, if the callback - functions can handle two versions of the state, but this function - cannot be used in the normal way.

-
- -
-
- - - Module:init(Args) -> {ok, State} | {ok, State, timeout()} | - {stop, Reason} - Makes necessary initializations and returns the - initial channel state if the initializations succeed. - - Args = term() - Last argument to start_link/4. - State = term() - Reason = term() - - -

Makes necessary initializations and returns the initial channel - state if the initializations succeed. -

-

For more detailed information on time-outs, see Section - Callback timeouts.

-
-
- - - Module:handle_call(Msg, From, State) -> Result - Handles messages sent by calling - call/[2,3]. - - Msg = term() - From = opaque() - Is to be used as argument to - reply/2 - State = term() - Result = {reply, Reply, NewState} | {reply, Reply, NewState, timeout()} - | {noreply, NewState} | {noreply , NewState, timeout()} - | {stop, Reason, Reply, NewState} | {stop, Reason, NewState} - Reply = term() - Will be the return value of call/[2,3] - NewState = term() - Reason = term() - - -

Handles messages sent by calling - call/[2,3] -

-

For more detailed information on time-outs,, see Section - Callback timeouts.

-
-
- - - Module:handle_cast(Msg, State) -> Result - Handles messages sent by calling - cast/2. - - Msg = term() - State = term() - Result = {noreply, NewState} | {noreply, NewState, timeout()} - | {stop, Reason, NewState} - NewState = term() - Reason = term() - - -

Handles messages sent by calling - cast/2. -

-

For more detailed information on time-outs, see Section - Callback timeouts.

-
-
- - - Module:handle_msg(Msg, State) -> {ok, State} | - {stop, ChannelId, State} - - Handles other messages than SSH connection protocol, - call, or cast messages sent to the channel. - - Msg = timeout | term() - ChannelId = ssh:channel_id() - State = term() - - -

Handles other messages than SSH Connection Protocol, call, or - cast messages sent to the channel. -

- -

Possible Erlang 'EXIT' messages is to be handled by this - function and all channels are to handle the following message.

- - - {ssh_channel_up, ssh:channel_id(), ssh:connection_ref()} -

This is the first message that the channel receives. - It is sent just before the init/1 function - returns successfully. This is especially useful if the - server wants to send a message to the client without first - receiving a message from it. If the message is not - useful for your particular scenario, ignore it by - immediately returning {ok, State}. -

-
-
-
- - - Module:handle_ssh_msg(Msg, State) -> {ok, State} | {stop, - ChannelId, State} - Handles ssh connection protocol messages. - - Msg = ssh_connection:event() - ChannelId = ssh:channel_id() - State = term() - - -

Handles SSH Connection Protocol messages that may need - service-specific attention. For details, - see ssh_connection:event(). -

- -

The following message is taken care of by the - ssh_channel behavior.

- - - {closed, ssh:channel_id()} -

The channel behavior sends a close message to the - other side, if such a message has not already been sent. - Then it terminates the channel with reason normal.

-
-
-
- - - Module:terminate(Reason, State) -> _ - Does cleaning up before channel process termination. - - - Reason = term() - State = term() - - -

This function is called by a channel process when it is - about to terminate. Before this function is called, ssh_connection:close/2 - is called, if it has not been called earlier. - This function does any necessary cleaning - up. When it returns, the channel process terminates with - reason Reason. The return value is ignored. -

-
-
- -
- - diff --git a/lib/ssh/doc/src/ssh_client_channel.xml b/lib/ssh/doc/src/ssh_client_channel.xml new file mode 100644 index 0000000000..eed49beffa --- /dev/null +++ b/lib/ssh/doc/src/ssh_client_channel.xml @@ -0,0 +1,440 @@ + + + + +
+ + 2009 + 2016 + Ericsson AB, All Rights Reserved + + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + The Initial Developer of the Original Code is Ericsson AB. + + ssh_client_channel + + + + +
+ ssh_client_channel + -behaviour(ssh_client_channel). (Replaces ssh_channel) + + + +

This module replaces ssh_channel.

+

The old module is still available for compatibility, but should not be used for new programs. + The old module will not be maintained except for some error corrections +

+
+

SSH services (clients and servers) are implemented as channels + that are multiplexed over an SSH connection and communicates over + the SSH + Connection Protocol. This module provides a callback API + that takes care of generic channel aspects for clients, such as flow control + and close messages. It lets the callback functions take care of + the service (application) specific parts. This behavior also ensures + that the channel process honors the principal of an OTP-process so + that it can be part of a supervisor tree. This is a requirement of + channel processes implementing a subsystem that will be added to + the ssh applications supervisor tree. +

+ +

When implementing a ssh subsystem for daemons, use + -behaviour(ssh_server_channel) (Replaces ssh_daemon_channel) + instead. +

+
+ + +

Functions in this module are not supposed to be called outside a module implementing this + behaviour! +

+
+ +
+ + + + call(ChannelRef, Msg) -> + call(ChannelRef, Msg, Timeout) -> Reply | {error, Reason} + Makes a synchronous call to a channel. + + ChannelRef = pid() + As returned by start_link/4 + Msg = term() + Timeout = timeout() + Reply = term() + Reason = closed | timeout + + + +

Makes a synchronous call to the channel process by sending + a message and waiting until a reply arrives, or a time-out + occurs. The channel calls Module:handle_call/3 + to handle the message. If the channel process does not exist, + {error, closed} is returned. +

+
+
+ + + cast(ChannelRef, Msg) -> ok + Sends an asynchronous message to the channel + ChannelRef and returns ok. + + ChannelRef = pid() + As returned by start_link/4 + Msg = term() + + +

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 calls + Module:handle_cast/2 + to handle the message. +

+
+
+ + + enter_loop(State) -> _ + Makes an existing process an ssh_client_channel (replaces ssh_channel) process. + + State = term() + as returned by init/1 + + +

Makes an existing process an ssh_client_channel (replaces ssh_channel) + process. Does not return, instead the calling process + enters the ssh_client_channel (replaces ssh_channel) process receive loop and become an + ssh_client_channel process. The process must have been started using + one of the start functions in proc_lib, see the proc_lib(3) manual page in STDLIB. + The user is responsible for any initialization of the process + and must call init/1. +

+
+
+ + + init(Options) -> {ok, State} | {ok, State, Timeout} | {stop, Reason} + Initiates an ssh_client_channel process. + + Options = [{Option, Value}] + State = term() + Timeout = timeout() + Reason = term() + + +

+ The following options must be present: +

+ + {channel_cb, atom()} +

The module that implements the channel behaviour.

+ + {init_args(), list()} +

The list of arguments to the init function of the callback module.

+ + {cm, ssh:connection_ref()} +

Reference to the ssh connection as returned by + ssh:connect/3. +

+ + {channel_id, ssh:channel_id()} +

Id of the ssh channel as returned by + ssh_connection:session_channel/2,4. +

+ +
+ +

This function is normally not called by the + user. The user only needs to call if the + channel process needs to be started with help of + proc_lib instead of calling + start/4 or + start_link/4.

+
+
+
+ + + reply(Client, Reply) -> _ + Sends a reply to a client. + + Client = opaque() + Reply = term() + + +

This function can be used by a channel to send a + reply to a client that called call/[2,3] when the reply + cannot be defined in the return value of + Module:handle_call/3.

+

Client must be the From argument provided to + the callback function handle_call/3. + Reply is an arbitrary term, + which is given back to the client as the return value of + call/[2,3].

+
+
+ + + start(SshConnection, ChannelId, ChannelCb, CbInitArgs) -> + start_link(SshConnection, ChannelId, ChannelCb, CbInitArgs) -> + {ok, ChannelRef} | {error, Reason} + Starts a process that handles an SSH channel. + + SshConnection = ssh:connection_ref() + As returned by ssh:connect/3 + + ChannelId = ssh:channel_id() + As returned by + + ssh_connection:session_channel/[2,4]. + + ChannelCb = atom() + Name of the module implementing the service-specific parts + of the channel. + + CbInitArgs = [term()] + Argument list for the init function in the callback module. + + ChannelRef = pid() + + +

Starts a process that handles an SSH channel. It is + called internally, by the ssh daemon, or explicitly by the ssh + client implementations. The behavior sets the + trap_exit flag to true. +

+
+
+ +
+ +
+ Callback Functions +

+ The following functions are to be exported from a + ssh_client_channel callback module. +

+ +
+ Callback timeouts +

The timeout values that can be returned by the callback functions + have the same semantics as in a gen_server. + If the time-out occurs, handle_msg/2 + is called as handle_msg(timeout, State).

+
+
+ + + + Module:code_change(OldVsn, State, Extra) -> {ok, + NewState} + Converts process state when code is changed. + + OldVsn = term() + In the case of an upgrade, OldVsn is Vsn, and + in the case of a downgrade, OldVsn is + {down,Vsn}. Vsn is defined by the vsn + attribute(s) of the old version of the callback module + Module. If no such attribute is defined, the version is + the checksum of the BEAM file. + State = term() + Internal state of the channel. + Extra = term() + Passed "as-is" from the {advanced,Extra} + part of the update instruction. + + +

Converts process state when code is changed.

+ +

This function is called by a client-side channel when it + is to update its internal state during a release + upgrade or downgrade, that is, when the instruction + {update,Module,Change,...}, where + Change={advanced,Extra}, is given in the appup + file. For more information, refer to Section 9.11.6 + Release Handling Instructions in the + System Documentation. +

+ +

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. The subsystem channels can + be upgraded when upgrading the user application, if the callback + functions can handle two versions of the state, but this function + cannot be used in the normal way.

+
+ +
+
+ + + Module:init(Args) -> {ok, State} | {ok, State, timeout()} | + {stop, Reason} + Makes necessary initializations and returns the + initial channel state if the initializations succeed. + + Args = term() + Last argument to start_link/4. + State = term() + Reason = term() + + +

Makes necessary initializations and returns the initial channel + state if the initializations succeed. +

+

For more detailed information on time-outs, see Section + Callback timeouts.

+
+
+ + + Module:handle_call(Msg, From, State) -> Result + Handles messages sent by calling + call/[2,3]. + + Msg = term() + From = opaque() + Is to be used as argument to + reply/2 + State = term() + Result = {reply, Reply, NewState} | {reply, Reply, NewState, timeout()} + | {noreply, NewState} | {noreply , NewState, timeout()} + | {stop, Reason, Reply, NewState} | {stop, Reason, NewState} + Reply = term() + Will be the return value of call/[2,3] + NewState = term() + Reason = term() + + +

Handles messages sent by calling + call/[2,3] +

+

For more detailed information on time-outs,, see Section + Callback timeouts.

+
+
+ + + Module:handle_cast(Msg, State) -> Result + Handles messages sent by calling + cast/2. + + Msg = term() + State = term() + Result = {noreply, NewState} | {noreply, NewState, timeout()} + | {stop, Reason, NewState} + NewState = term() + Reason = term() + + +

Handles messages sent by calling + cast/2. +

+

For more detailed information on time-outs, see Section + Callback timeouts.

+
+
+ + + Module:handle_msg(Msg, State) -> {ok, State} | + {stop, ChannelId, State} + + Handles other messages than SSH connection protocol, + call, or cast messages sent to the channel. + + Msg = timeout | term() + ChannelId = ssh:channel_id() + State = term() + + +

Handles other messages than SSH Connection Protocol, call, or + cast messages sent to the channel. +

+ +

Possible Erlang 'EXIT' messages is to be handled by this + function and all channels are to handle the following message.

+ + + {ssh_channel_up, ssh:channel_id(), ssh:connection_ref()} +

This is the first message that the channel receives. + It is sent just before the init/1 function + returns successfully. This is especially useful if the + server wants to send a message to the client without first + receiving a message from it. If the message is not + useful for your particular scenario, ignore it by + immediately returning {ok, State}. +

+
+
+
+ + + Module:handle_ssh_msg(Msg, State) -> {ok, State} | {stop, + ChannelId, State} + Handles ssh connection protocol messages. + + Msg = ssh_connection:event() + ChannelId = ssh:channel_id() + State = term() + + +

Handles SSH Connection Protocol messages that may need + service-specific attention. For details, + see ssh_connection:event(). +

+ +

The following message is taken care of by the + ssh_client_channel behavior.

+ + + {closed, ssh:channel_id()} +

The channel behavior sends a close message to the + other side, if such a message has not already been sent. + Then it terminates the channel with reason normal.

+
+
+
+ + + Module:terminate(Reason, State) -> _ + Does cleaning up before channel process termination. + + + Reason = term() + State = term() + + +

This function is called by a channel process when it is + about to terminate. Before this function is called, ssh_connection:close/2 + is called, if it has not been called earlier. + This function does any necessary cleaning + up. When it returns, the channel process terminates with + reason Reason. The return value is ignored. +

+
+
+ +
+ +
diff --git a/lib/ssh/doc/src/ssh_connection.xml b/lib/ssh/doc/src/ssh_connection.xml index cfe5385eb4..821dfef93d 100644 --- a/lib/ssh/doc/src/ssh_connection.xml +++ b/lib/ssh/doc/src/ssh_connection.xml @@ -44,9 +44,9 @@ If the receiving channel is an Erlang process, the messages have the format . - If the ssh_channel behavior is used to + If the ssh_client_channel behavior is used to implement the channel process, these messages are handled by - handle_ssh_msg/2.

+ handle_ssh_msg/2.

@@ -131,7 +131,7 @@

This event is sent as a result of calling ssh_connection:close/2. Both the handling of this event and sending it are taken care of by the - ssh_channel behavior.

+ ssh_client_channel behavior.

@@ -212,10 +212,10 @@

Adjusts the SSH flow control window. This is to be done by both the client- and server-side channel processes.

-

Channels implemented with the ssh_channel +

Channels implemented with the ssh_client_channel behavior do not normally need to call this function as flow control is handled by the behavior. The behavior adjusts the window every time - the callback + the callback handle_ssh_msg/2 returns after processing channel data.

@@ -232,9 +232,9 @@ sending a close event.

-

This function is called by the ssh_channel +

This function is called by the ssh_client_channel behavior when the channel is terminated, see ssh_channel(3). Thus, channels implemented + marker="ssh_client_channel"> ssh_client_channel(3). Thus, channels implemented with the behavior are not to call this function explicitly.

@@ -277,7 +277,7 @@ 1 x {ssh_cm, connection_ref(), {closed, channel_id()}} -

Indicates that the ssh_channel started for the +

Indicates that the ssh_client_channel started for the execution of the command has now been shut down.

diff --git a/lib/ssh/doc/src/ssh_daemon_channel.xml b/lib/ssh/doc/src/ssh_daemon_channel.xml deleted file mode 100644 index 254f75a4de..0000000000 --- a/lib/ssh/doc/src/ssh_daemon_channel.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - -
- - 2009 - 2016 - Ericsson AB, All Rights Reserved - - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - The Initial Developer of the Original Code is Ericsson AB. - - ssh_daemon_channel - - - - -
- ssh_daemon_channel - -behaviour(ssh_daemon_channel). - - -

This behaviour should NOT be used for new programs but is kept for compatibility. -

-

It is replaced by ssh_server_channel.

-
- - - - Module:CALLBACK(..) - ssh_daemon_channel is replaced by ssh_server_channel - -

See ssh_server_channel which replaces this module. -

-
-
-
- -
diff --git a/lib/ssh/doc/src/ssh_protocol.xml b/lib/ssh/doc/src/ssh_protocol.xml index 4548d7bbb6..53f0524b97 100644 --- a/lib/ssh/doc/src/ssh_protocol.xml +++ b/lib/ssh/doc/src/ssh_protocol.xml @@ -88,7 +88,7 @@ SSH client will open a channel, send data/commands, receive data/"control information" and when it is done close the channel. The - ssh_channel / + ssh_client_channel / ssh_server_channel (Replaces ssh_daemon_channel) behaviours makes it easy to write your own SSH client/server processes that use flow diff --git a/lib/ssh/doc/src/ssh_server_channel.xml b/lib/ssh/doc/src/ssh_server_channel.xml index 19fc20fcda..af51ec470b 100644 --- a/lib/ssh/doc/src/ssh_server_channel.xml +++ b/lib/ssh/doc/src/ssh_server_channel.xml @@ -54,7 +54,7 @@

When implementing a client subsystem handler, use - -behaviour(ssh_channel) instead. + -behaviour(ssh_client_channel) instead.

diff --git a/lib/ssh/doc/src/using_ssh.xml b/lib/ssh/doc/src/using_ssh.xml index fef0784eb6..efd2a997f5 100644 --- a/lib/ssh/doc/src/using_ssh.xml +++ b/lib/ssh/doc/src/using_ssh.xml @@ -384,7 +384,7 @@ terminate(_Reason, _State) -> {ssh_msg, <0.57.0>, {closed, 0}} 7> {error, closed} = ssh_connection:send(ConnectionRef, ChannelId, "10", infinity). -

See also ssh_channel(3).

+

See also ssh_client_channel(3) (replaces ssh_channel(3)).

-- cgit v1.2.3