From 23cd65b80b395ad83e69618989ccc0bef13edd0a Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Fri, 20 Mar 2015 22:22:41 +0100 Subject: Set {string_decode, false} in examples So as to do what's now recommended in diameter(1), in the grandparent commit. --- lib/diameter/examples/code/client.erl | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/diameter/examples/code/client.erl') diff --git a/lib/diameter/examples/code/client.erl b/lib/diameter/examples/code/client.erl index be5b4cbba5..9b0972c8d1 100644 --- a/lib/diameter/examples/code/client.erl +++ b/lib/diameter/examples/code/client.erl @@ -68,6 +68,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}]}]). -- cgit v1.2.3 From 949cec3fdcf94310aa567921ac2ea37569beb970 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Sat, 21 Mar 2015 19:10:19 +0100 Subject: Let examples override default service options To make them a bit more flexible. Can now do things like this: server:start([{'Product-Name', "Bob"}]), server:listen({tcp, [{capx_timeout, 2000}]}) Beware that the latter is completely different from this: server:listen(tcp, [{capx_timeout, 2000}]) --- lib/diameter/examples/code/client.erl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lib/diameter/examples/code/client.erl') diff --git a/lib/diameter/examples/code/client.erl b/lib/diameter/examples/code/client.erl index 9b0972c8d1..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 @@ -77,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) -> -- cgit v1.2.3