diff options
author | Hans Nilsson <[email protected]> | 2013-09-30 16:35:09 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2013-10-28 16:09:20 +0100 |
commit | f5495aa1560daf65c063a8d5b99a5ea17520ea92 (patch) | |
tree | 93a94f73c882ab25f9ed3c7fddd4f5237551bd9b /lib/ssh/src/ssh.erl | |
parent | d54e4318a77c7a42a7b8952780b33987775c7608 (diff) | |
download | otp-f5495aa1560daf65c063a8d5b99a5ea17520ea92.tar.gz otp-f5495aa1560daf65c063a8d5b99a5ea17520ea92.tar.bz2 otp-f5495aa1560daf65c063a8d5b99a5ea17520ea92.zip |
ssh: Add ssh:sockname/1 incl doc and tests
OTP-11345, sto575, tsk374
Diffstat (limited to 'lib/ssh/src/ssh.erl')
-rw-r--r-- | lib/ssh/src/ssh.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl index 718321ef21..80d20abbbd 100644 --- a/lib/ssh/src/ssh.erl +++ b/lib/ssh/src/ssh.erl @@ -29,6 +29,7 @@ channel_info/3, daemon/1, daemon/2, daemon/3, peername/1, + sockname/1, stop_listener/1, stop_listener/2, stop_daemon/1, stop_daemon/2, shell/1, shell/2, shell/3]). @@ -257,6 +258,17 @@ peername(ConnectionRef) -> {ok, {IP,Port}}. %%-------------------------------------------------------------------- +%% Function: sockname(ConnectionRef) -> {ok, {Host,Port}} +%% | {error,Error} +%% +%% Description: Returns the local address of the connection +%%-------------------------------------------------------------------- +sockname(ConnectionRef) -> + [{sockname, Result}] = + ssh_connection_manager:connection_info(ConnectionRef, [sockname]), + Result. + +%%-------------------------------------------------------------------- %%% Internal functions %%-------------------------------------------------------------------- fix_idle_time(SshOptions) -> |