aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/examples/code/client.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2015-03-24 11:01:36 +0100
committerAnders Svensson <[email protected]>2015-03-24 11:01:36 +0100
commitb7d8668ea5a4215da900bfcd2a1dbd51384cb0c7 (patch)
tree4b9900e8668867cfb94dce4d187b560828ab9134 /lib/diameter/examples/code/client.erl
parentbcecea772faea599ffd56776b1177865f08ca7b5 (diff)
parent949cec3fdcf94310aa567921ac2ea37569beb970 (diff)
downloadotp-b7d8668ea5a4215da900bfcd2a1dbd51384cb0c7.tar.gz
otp-b7d8668ea5a4215da900bfcd2a1dbd51384cb0c7.tar.bz2
otp-b7d8668ea5a4215da900bfcd2a1dbd51384cb0c7.zip
Merge branch 'anders/diameter/string_decode/OTP-11952' into maint
* anders/diameter/string_decode/OTP-11952: Let examples override default service options Set {restrict_connections, false} in example server Set {string_decode, false} in examples Test {string_decode, false} in traffic suite Add service_opt() string_decode Strip potentially large terms when sending outgoing Diameter messages Improve language consistency in diameter(1)
Diffstat (limited to 'lib/diameter/examples/code/client.erl')
-rw-r--r--lib/diameter/examples/code/client.erl16
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) ->