diff options
author | Ingela Anderton Andin <[email protected]> | 2012-02-22 12:07:11 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2012-02-28 10:26:56 +0100 |
commit | 1aeb8f4234b52705f9a933abf8dcd1afb2296b9d (patch) | |
tree | 1b866333a0d627ff2e321d638ace080098f2f6ce /lib/ssh/test/ssh_test_lib.erl | |
parent | 76cf3d914cadc98ead9889b66d2812a46fb5d5b2 (diff) | |
download | otp-1aeb8f4234b52705f9a933abf8dcd1afb2296b9d.tar.gz otp-1aeb8f4234b52705f9a933abf8dcd1afb2296b9d.tar.bz2 otp-1aeb8f4234b52705f9a933abf8dcd1afb2296b9d.zip |
Prevent client hanging. (OTP-8111)
Restored supervisor tree so that error propagation will work as
intended, although connection processes are set to temporary, instead
of permanent with restart times set to 0, and termination of the
connection subtree is initiated by a temporary process spawned by
ssh_connection_managers terminate. This is done to avoid unwanted
supervisor reports. Pherhaps we need some new supervisor
functionality.
Diffstat (limited to 'lib/ssh/test/ssh_test_lib.erl')
-rw-r--r-- | lib/ssh/test/ssh_test_lib.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/ssh/test/ssh_test_lib.erl b/lib/ssh/test/ssh_test_lib.erl index c8a4fe1c62..609663c87a 100644 --- a/lib/ssh/test/ssh_test_lib.erl +++ b/lib/ssh/test/ssh_test_lib.erl @@ -334,3 +334,13 @@ del_dirs(Dir) -> _ -> ok end. + +inet_port(Node) -> + {Port, Socket} = do_inet_port(Node), + rpc:call(Node, gen_tcp, close, [Socket]), + Port. + +do_inet_port(Node) -> + {ok, Socket} = rpc:call(Node, gen_tcp, listen, [0, [{reuseaddr, true}]]), + {ok, Port} = rpc:call(Node, inet, port, [Socket]), + {Port, Socket}. |