aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/examples/code/relay.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2015-03-05 01:33:59 +0100
committerAnders Svensson <[email protected]>2015-03-05 01:33:59 +0100
commita4df8f2e68ccef9936c5b43378a006099d81f801 (patch)
treeafa365a841b523df8f60b7962f4afee77033e5d7 /lib/diameter/examples/code/relay.erl
parentd1c58149851faf22d3b05e71d011f86324aba01d (diff)
parent6aabb5176a176f3413a446ad13178eb25c4c90fd (diff)
downloadotp-a4df8f2e68ccef9936c5b43378a006099d81f801.tar.gz
otp-a4df8f2e68ccef9936c5b43378a006099d81f801.tar.bz2
otp-a4df8f2e68ccef9936c5b43378a006099d81f801.zip
Merge branch 'anders/diameter/pool/OTP-12428' into maint
* anders/diameter/pool/OTP-12428: Fix SCTP match blunder in suites Be backwards compatible with diameter_sctp listener state Add gen_tcp testcase that fails sporadically Simplify transport suite Remove (ancient) dead code Don't orphan slave nodes in example suite Refresh example code Improve language consistency in diameter(1) Add pool suite to test transport_opt() pool_size Adapt tcp/sctp transport modules for pool_size > 1 Add transport_opt() pool_size
Diffstat (limited to 'lib/diameter/examples/code/relay.erl')
-rw-r--r--lib/diameter/examples/code/relay.erl33
1 files changed, 14 insertions, 19 deletions
diff --git a/lib/diameter/examples/code/relay.erl b/lib/diameter/examples/code/relay.erl
index d3438f83f3..0aa3cd06d3 100644
--- a/lib/diameter/examples/code/relay.erl
+++ b/lib/diameter/examples/code/relay.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2015. 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
@@ -31,9 +31,6 @@
-module(relay).
--include_lib("diameter/include/diameter.hrl").
--include_lib("diameter/include/diameter_gen_base_rfc3588.hrl").
-
-export([start/1,
listen/2,
connect/2,
@@ -44,49 +41,47 @@
connect/1,
stop/0]).
--define(APP_ALIAS, ?MODULE).
--define(SVC_NAME, ?MODULE).
--define(CALLBACK_MOD, relay_cb).
+-define(DEF_SVC_NAME, ?MODULE).
%% The service configuration.
-define(SERVICE(Name), [{'Origin-Host', atom_to_list(Name) ++ ".example.com"},
{'Origin-Realm', "example.com"},
{'Vendor-Id', 193},
{'Product-Name', "RelayAgent"},
- {'Auth-Application-Id', [?DIAMETER_APP_ID_RELAY]},
- {application, [{alias, ?MODULE},
- {dictionary, ?DIAMETER_DICT_RELAY},
- {module, ?CALLBACK_MOD}]}]).
+ {'Auth-Application-Id', [16#FFFFFFFF]},
+ {application, [{alias, relay},
+ {dictionary, diameter_relay},
+ {module, relay_cb}]}]).
%% start/1
start(Name)
when is_atom(Name) ->
- peer:start(Name, ?SERVICE(Name)).
+ node:start(Name, ?SERVICE(Name)).
start() ->
- start(?SVC_NAME).
+ start(?DEF_SVC_NAME).
%% listen/2
listen(Name, T) ->
- peer:listen(Name, T).
+ node:listen(Name, T).
listen(T) ->
- listen(?SVC_NAME, T).
+ listen(?DEF_SVC_NAME, T).
%% connect/2
connect(Name, T) ->
- peer:connect(Name, T).
+ node:connect(Name, T).
connect(T) ->
- connect(?SVC_NAME, T).
+ connect(?DEF_SVC_NAME, T).
%% stop/1
stop(Name) ->
- peer:stop(Name).
+ node:stop(Name).
stop() ->
- stop(?SVC_NAME).
+ stop(?DEF_SVC_NAME).