4
%% Copyright Ericsson AB 2009. All Rights Reserved.
4
%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
19
19
%%--------------------------------------------------------------------
99
99
handle_call({handler, Pid, [Role, Socket, Opts]}, _From, State) ->
100
100
{ok, Handler} = ssh_connection_handler:start_link(Role, Pid, Socket, Opts),
101
101
{reply, {ok, Handler}, State#state{handler = Handler}};
102
handle_call({manager, [server = Role, Socket, Opts]}, _From, State) ->
103
{ok, Manager} = ssh_connection_manager:start_link([Role, Socket, Opts]),
102
handle_call({manager, [server = Role, Socket, Opts, SubSysSup]}, _From, State) ->
103
{ok, Manager} = ssh_connection_manager:start_link([Role, Socket, Opts, SubSysSup]),
104
104
{reply, {ok, Manager}, State#state{manager = Manager}};
105
105
handle_call({manager, [client = Role | Opts]}, _From, State) ->
106
106
{ok, Manager} = ssh_connection_manager:start_link([Role, Opts]),
126
126
%% handle_info(ssh_connected, State) ->
127
127
%% {stop, normal, State};
128
128
%% Servant termination.
129
handle_info({'EXIT', _Pid, normal}, State) ->
130
{stop, normal, State}.
129
handle_info({'EXIT', _Pid, Reason}, State) ->
130
{stop, Reason, State}.
132
132
%%-----------------------------------------------------------------
133
133
%% Func: code_change/3