diff options
author | Ingela Anderton Andin <[email protected]> | 2013-12-02 09:52:58 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2013-12-02 09:52:58 +0100 |
commit | 239ce1c4781fe4fc25c55795573654453887f507 (patch) | |
tree | 256c7436d2d1e24407422fb525e71258fe23334e /lib/ssl/src/dtls_connection_sup.erl | |
parent | d3e5761436cfbcb5b53edad9e1140e445ce94bfd (diff) | |
parent | 174b36ae2755b501e2b3152f6b00e9c59a90e848 (diff) | |
download | otp-239ce1c4781fe4fc25c55795573654453887f507.tar.gz otp-239ce1c4781fe4fc25c55795573654453887f507.tar.bz2 otp-239ce1c4781fe4fc25c55795573654453887f507.zip |
Merge branch 'ia/ssl/dtls-refactor-continue/OTP-11292' into maint
* ia/ssl/dtls-refactor-continue/OTP-11292:
ssl: Trap exits
ssl: Refactor connetion handling
ssl: API and supervisor
ssl: Dialyzer fixes
ssl: Test case enhancement
ssl: Refactor API
ssl, public_key: Dialyzer fixes
ssl: Refactor premaster secret handling
ssl: Refactor connection and handshake handling
ssl: Refactor handshake and record handling
Diffstat (limited to 'lib/ssl/src/dtls_connection_sup.erl')
-rw-r--r-- | lib/ssl/src/dtls_connection_sup.erl | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/lib/ssl/src/dtls_connection_sup.erl b/lib/ssl/src/dtls_connection_sup.erl new file mode 100644 index 0000000000..9fe545be18 --- /dev/null +++ b/lib/ssl/src/dtls_connection_sup.erl @@ -0,0 +1,60 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2007-2013. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% + +%% +%%---------------------------------------------------------------------- +%% Purpose: Supervisor of DTLS connection. +%%---------------------------------------------------------------------- +-module(dtls_connection_sup). + +-behaviour(supervisor). + +%% API +-export([start_link/0]). +-export([start_child/1]). + +%% Supervisor callback +-export([init/1]). + +%%%========================================================================= +%%% API +%%%========================================================================= +start_link() -> + supervisor:start_link({local, ?MODULE}, ?MODULE, []). + +start_child(Args) -> + supervisor:start_child(?MODULE, Args). + +%%%========================================================================= +%%% Supervisor callback +%%%========================================================================= +init(_O) -> + RestartStrategy = simple_one_for_one, + MaxR = 0, + MaxT = 3600, + + Name = undefined, % As simple_one_for_one is used. + StartFunc = {dtls_connection, start_link, []}, + Restart = temporary, % E.g. should not be restarted + Shutdown = 4000, + Modules = [dtls_connection], + Type = worker, + + ChildSpec = {Name, StartFunc, Restart, Shutdown, Type, Modules}, + {ok, {{RestartStrategy, MaxR, MaxT}, [ChildSpec]}}. |