diff options
author | Anders Svensson <[email protected]> | 2015-03-24 11:03:23 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2015-03-24 11:03:23 +0100 |
commit | 8cad0980fd09b36fe71ee91dd65e56fadb5a22b8 (patch) | |
tree | f3e587be5a8c16ee7f133bfd08f546c001d91cdc /lib/diameter/examples/code/client.erl | |
parent | 487446e76102b27fa8df02a353c7fdeec2d091f1 (diff) | |
parent | 79b86a035adb0068e544401104d4c04db8e2b181 (diff) | |
download | otp-8cad0980fd09b36fe71ee91dd65e56fadb5a22b8.tar.gz otp-8cad0980fd09b36fe71ee91dd65e56fadb5a22b8.tar.bz2 otp-8cad0980fd09b36fe71ee91dd65e56fadb5a22b8.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/diameter/examples/code/client.erl')
-rw-r--r-- | lib/diameter/examples/code/client.erl | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/diameter/examples/code/client.erl b/lib/diameter/examples/code/client.erl index be5b4cbba5..844c9cdbdd 100644 --- a/lib/diameter/examples/code/client.erl +++ b/lib/diameter/examples/code/client.erl @@ -41,6 +41,7 @@ -include_lib("diameter/include/diameter_gen_base_rfc6733.hrl"). -export([start/1, %% start a service + start/2, %% connect/2, %% add a connecting transport call/1, %% send using the record encoding cast/1, %% send using the list encoding and detached @@ -68,6 +69,7 @@ {'Vendor-Id', 0}, {'Product-Name', "Client"}, {'Auth-Application-Id', [0]}, + {string_decode, false}, {application, [{alias, common}, {dictionary, diameter_gen_base_rfc6733}, {module, client_cb}]}]). @@ -76,11 +78,23 @@ start(Name) when is_atom(Name) -> - node:start(Name, ?SERVICE(Name)). + start(Name, []); + +start(Opts) + when is_list(Opts) -> + start(?DEF_SVC_NAME, Opts). + +%% start/0 start() -> start(?DEF_SVC_NAME). +%% start/2 + +start(Name, Opts) -> + node:start(Name, Opts ++ [T || {K,_} = T <- ?SERVICE(Name), + false == lists:keymember(K, 1, Opts)]). + %% connect/2 connect(Name, T) -> |