aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/examples/gen_tcp_dist/src
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2019-03-13 21:34:09 +0100
committerRickard Green <[email protected]>2019-03-20 18:46:07 +0100
commit214b657769dd60cf2eab1824f6791225f5720a5a (patch)
tree38ef1fade19a3e8e83fa7d7956f64bc22e8484c3 /lib/kernel/examples/gen_tcp_dist/src
parent80abf9d57e754bcb6b80d0501450a40bb281d3b6 (diff)
downloadotp-214b657769dd60cf2eab1824f6791225f5720a5a.tar.gz
otp-214b657769dd60cf2eab1824f6791225f5720a5a.tar.bz2
otp-214b657769dd60cf2eab1824f6791225f5720a5a.zip
Testing of the example gen_tcp_dist module
This also imply testing of processes as distribution controllers using the erlang:dist_ctrl_* BIFs.
Diffstat (limited to 'lib/kernel/examples/gen_tcp_dist/src')
-rw-r--r--lib/kernel/examples/gen_tcp_dist/src/gen_tcp_dist.erl15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/kernel/examples/gen_tcp_dist/src/gen_tcp_dist.erl b/lib/kernel/examples/gen_tcp_dist/src/gen_tcp_dist.erl
index 98554ed805..cda4c470f9 100644
--- a/lib/kernel/examples/gen_tcp_dist/src/gen_tcp_dist.erl
+++ b/lib/kernel/examples/gen_tcp_dist/src/gen_tcp_dist.erl
@@ -53,10 +53,10 @@
-import(error_logger,[error_msg/2]).
--include("net_address.hrl").
+-include_lib("kernel/include/net_address.hrl").
--include("dist.hrl").
--include("dist_util.hrl").
+-include_lib("kernel/include/dist.hrl").
+-include_lib("kernel/include/dist_util.hrl").
%% ------------------------------------------------------------
%% Select this protocol based on node name
@@ -679,7 +679,14 @@ dist_cntrlr_setup_loop(Socket, TickHandler, Sup) ->
%% From now on we execute on normal priority
process_flag(priority, normal),
erlang:dist_ctrl_get_data_notification(DHandle),
- dist_cntrlr_output_loop(DHandle, Socket)
+ case init:get_argument(gen_tcp_dist_output_loop) of
+ error ->
+ dist_cntrlr_output_loop(DHandle, Socket);
+ {ok, [[ModStr, FuncStr]]} -> % For testing...
+ apply(list_to_atom(ModStr),
+ list_to_atom(FuncStr),
+ [DHandle, Socket])
+ end
end.
%% We use active 10 for good throughput while still