From 7e798810cad67ce0cdc91ca57624ff2a6ea3431e Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Mon, 22 Feb 2016 11:10:53 +0000 Subject: Fix ssl example As recently discussed on the erlang-questions mailing list, this example fails to start the ssl application because ssl depends on asn1 nowadays. Let's future-proof this by using application:ensure_all_started/1. --- lib/ssl/examples/src/client_server.erl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/ssl/examples/src/client_server.erl b/lib/ssl/examples/src/client_server.erl index 799027123f..019b5130d2 100644 --- a/lib/ssl/examples/src/client_server.erl +++ b/lib/ssl/examples/src/client_server.erl @@ -26,9 +26,7 @@ start() -> %% Start ssl application - application:start(crypto), - application:start(public_key), - application:start(ssl), + {ok, StartedApps} = application:ensure_all_started(ssl), %% Let the current process be the server that listens and accepts %% Listen @@ -52,7 +50,8 @@ start() -> ssl:close(ASock), io:fwrite("Listen: closing and terminating.~n"), ssl:close(LSock), - application:stop(ssl). + + lists:foreach(fun application:stop/1, lists:reverse(StartedApps)). %% Client connect -- cgit v1.2.3