aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-04-17 16:53:08 +0200
committerMicael Karlberg <[email protected]>2019-05-29 15:13:48 +0200
commit08f4df99bbaafbba86a216734fa603bd2996f2a3 (patch)
tree6c5152923c920de2d2273fb0476125dcadba71ac /erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
parent22258359ff6633300ea6f28638eaae66deb0649a (diff)
downloadotp-08f4df99bbaafbba86a216734fa603bd2996f2a3.tar.gz
otp-08f4df99bbaafbba86a216734fa603bd2996f2a3.tar.bz2
otp-08f4df99bbaafbba86a216734fa603bd2996f2a3.zip
[socket|test] Add async to ttest
Make it possible for the tttest server to run with async.
Diffstat (limited to 'erts/emulator/test/socket_test_ttest_tcp_client_socket.erl')
-rw-r--r--erts/emulator/test/socket_test_ttest_tcp_client_socket.erl82
1 files changed, 44 insertions, 38 deletions
diff --git a/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl b/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
index ccace2a560..ca7eff4437 100644
--- a/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
+++ b/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
@@ -21,89 +21,95 @@
-module(socket_test_ttest_tcp_client_socket).
-export([
- start/3, start/4, start/6, start/7,
+ start/4, start/5, start/7, start/8,
stop/1
]).
-define(TRANSPORT_MOD, socket_test_ttest_tcp_socket).
--define(MOD(D, M), {?TRANSPORT_MOD, #{domain => D, method => M}}).
+-define(MOD(D, A, M), {?TRANSPORT_MOD, #{domain => D,
+ async => A,
+ method => M}}).
-start(Method, ServerInfo, Active)
+start(Method, Async, Active, ServerInfo)
when is_list(ServerInfo) ->
Domain = local,
- socket_test_ttest_tcp_client:start_monitor(?MOD(Domain, Method),
- ServerInfo, Active);
-start(Method, ServerInfo = {Addr, _}, Active)
+ socket_test_ttest_tcp_client:start_monitor(?MOD(Domain, Async, Method),
+ Active, ServerInfo);
+start(Method, Async, Active, ServerInfo = {Addr, _})
when is_tuple(Addr) andalso (size(Addr) =:= 4) ->
Domain = inet,
- socket_test_ttest_tcp_client:start_monitor(?MOD(Domain, Method),
- ServerInfo, Active);
-start(Method, ServerInfo = {Addr, _}, Active)
+ socket_test_ttest_tcp_client:start_monitor(?MOD(Domain, Async, Method),
+ Active, ServerInfo);
+start(Method, Async, Active, ServerInfo = {Addr, _})
when is_tuple(Addr) andalso (size(Addr) =:= 8) ->
Domain = inet6,
- socket_test_ttest_tcp_client:start_monitor(?MOD(Domain, Method),
- ServerInfo, Active).
+ socket_test_ttest_tcp_client:start_monitor(?MOD(Domain, Async, Method),
+ Active, ServerInfo).
-start(Method, ServerInfo, Active, MsgID)
+start(Method, Async, Active, ServerInfo, MsgID)
when is_list(ServerInfo) ->
%% This is just a simplification
Domain = local,
- socket_test_ttest_tcp_client:start(?MOD(Domain, Method),
- ServerInfo, Active, MsgID);
-start(Method, ServerInfo = {Addr, _}, Active, MsgID)
+ socket_test_ttest_tcp_client:start(?MOD(Domain, Async, Method),
+ Active, ServerInfo, MsgID);
+start(Method, Async, Active, ServerInfo = {Addr, _}, MsgID)
when is_tuple(Addr) andalso (size(Addr) =:= 4) ->
%% This is just a simplification
Domain = inet,
- socket_test_ttest_tcp_client:start(?MOD(Domain, Method),
- ServerInfo, Active, MsgID);
-start(Method, ServerInfo = {Addr, _}, Active, MsgID)
+ socket_test_ttest_tcp_client:start(?MOD(Domain, Async, Method),
+ Active, ServerInfo, MsgID);
+start(Method, Async, Active, ServerInfo = {Addr, _}, MsgID)
when is_tuple(Addr) andalso (size(Addr) =:= 8) ->
Domain = inet6,
- socket_test_ttest_tcp_client:start(?MOD(Domain, Method),
- ServerInfo, Active, MsgID).
+ socket_test_ttest_tcp_client:start(?MOD(Domain, Async, Method),
+ Active, ServerInfo, MsgID).
-start(Method, ServerInfo, Active, MsgID, MaxOutstanding, RunTime)
+start(Method, Async, Active, ServerInfo, MsgID, MaxOutstanding, RunTime)
when is_list(ServerInfo) ->
Domain = local,
socket_test_ttest_tcp_client:start(false,
- ?MOD(Domain, Method),
- ServerInfo, Active,
+ ?MOD(Domain, Async, Method),
+ Active, ServerInfo,
MsgID, MaxOutstanding, RunTime);
-start(Method, ServerInfo = {Addr, _}, Active, MsgID, MaxOutstanding, RunTime)
+start(Method, Async, Active, ServerInfo = {Addr, _},
+ MsgID, MaxOutstanding, RunTime)
when is_tuple(Addr) andalso (size(Addr) =:= 4) ->
Domain = inet,
socket_test_ttest_tcp_client:start(false,
- ?MOD(Domain, Method),
- ServerInfo, Active,
+ ?MOD(Domain, Async, Method),
+ Active, ServerInfo,
MsgID, MaxOutstanding, RunTime);
-start(Method, ServerInfo = {Addr, _}, Active, MsgID, MaxOutstanding, RunTime)
+start(Method, Async, Active, ServerInfo = {Addr, _},
+ MsgID, MaxOutstanding, RunTime)
when is_tuple(Addr) andalso (size(Addr) =:= 8) ->
Domain = inet6,
socket_test_ttest_tcp_client:start(false,
- ?MOD(Domain, Method),
- ServerInfo, Active,
+ ?MOD(Domain, Async, Method),
+ Active, ServerInfo,
MsgID, MaxOutstanding, RunTime).
-start(Quiet, Method, ServerInfo, Active, MsgID, MaxOutstanding, RunTime)
+start(Quiet, Async, Active, Method, ServerInfo, MsgID, MaxOutstanding, RunTime)
when is_list(ServerInfo) ->
Domain = local,
socket_test_ttest_tcp_client:start(Quiet,
- ?MOD(Domain, Method),
- ServerInfo, Active,
+ ?MOD(Domain, Async, Method),
+ Active, ServerInfo,
MsgID, MaxOutstanding, RunTime);
-start(Quiet, Method, ServerInfo = {Addr, _}, Active, MsgID, MaxOutstanding, RunTime)
+start(Quiet, Async, Active, Method, ServerInfo = {Addr, _},
+ MsgID, MaxOutstanding, RunTime)
when is_tuple(Addr) andalso (size(Addr) =:= 4) ->
Domain = inet,
socket_test_ttest_tcp_client:start(Quiet,
- ?MOD(Domain, Method),
- ServerInfo, Active,
+ ?MOD(Domain, Async, Method),
+ Active, ServerInfo,
MsgID, MaxOutstanding, RunTime);
-start(Quiet, Method, ServerInfo = {Addr, _}, Active, MsgID, MaxOutstanding, RunTime)
+start(Quiet, Async, Active, Method, ServerInfo = {Addr, _},
+ MsgID, MaxOutstanding, RunTime)
when is_tuple(Addr) andalso (size(Addr) =:= 8) ->
Domain = inet6,
socket_test_ttest_tcp_client:start(Quiet,
- ?MOD(Domain, Method),
- ServerInfo, Active,
+ ?MOD(Domain, Async, Method),
+ Active, ServerInfo,
MsgID, MaxOutstanding, RunTime).
stop(Pid) ->