aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
diff options
context:
space:
mode:
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.erl60
1 files changed, 47 insertions, 13 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 acf2556793..5b2a494ba0 100644
--- a/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
+++ b/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
@@ -21,30 +21,64 @@
-module(socket_test_ttest_tcp_client_socket).
-export([
- start/4, start/5, start/7, start/8,
+ start/3, start/4, start/6, start/7,
stop/1
]).
-define(TRANSPORT_MOD, socket_test_ttest_tcp_socket).
--define(MOD(M), {?TRANSPORT_MOD, #{method => Method}}).
+-define(MOD(D, M), {?TRANSPORT_MOD, #{domain => D, method => M}}).
-start(Method, Active, Addr, Port) ->
- socket_test_ttest_tcp_client:start_monitor(?MOD(Method), Active, Addr, Port).
+start(Method, ServerInfo = {Addr, _}, Active)
+ 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)
+ when is_tuple(Addr) andalso (size(Addr) =:= 8) ->
+ Domain = inet6,
+ socket_test_ttest_tcp_client:start_monitor(?MOD(Domain, Method),
+ ServerInfo, Active).
-start(Method, Active, Addr, Port, MsgID) ->
- socket_test_ttest_tcp_client:start(?MOD(Method),
- Active, Addr, Port, MsgID).
+start(Method, ServerInfo = {Addr, _}, Active, 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)
+ when is_tuple(Addr) andalso (size(Addr) =:= 8) ->
+ Domain = inet6,
+ socket_test_ttest_tcp_client:start(?MOD(Domain, Method),
+ ServerInfo, Active, MsgID).
-start(Method, Active, Addr, Port, MsgID, MaxOutstanding, RunTime) ->
+start(Method, ServerInfo = {Addr, _}, Active, MsgID, MaxOutstanding, RunTime)
+ when is_tuple(Addr) andalso (size(Addr) =:= 4) ->
+ Domain = inet,
socket_test_ttest_tcp_client:start(false,
- ?MOD(Method),
- Active, Addr, Port,
+ ?MOD(Domain, Method),
+ ServerInfo, Active,
+ MsgID, MaxOutstanding, RunTime);
+start(Method, ServerInfo = {Addr, _}, Active, 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,
MsgID, MaxOutstanding, RunTime).
-start(Quiet, Method, Active, Addr, Port, MsgID, MaxOutstanding, RunTime) ->
+start(Quiet, Method, ServerInfo = {Addr, _}, Active, 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,
+ MsgID, MaxOutstanding, RunTime);
+start(Quiet, Method, ServerInfo = {Addr, _}, Active, MsgID, MaxOutstanding, RunTime)
+ when is_tuple(Addr) andalso (size(Addr) =:= 8) ->
+ Domain = inet6,
socket_test_ttest_tcp_client:start(Quiet,
- ?MOD(Method),
- Active, Addr, Port,
+ ?MOD(Domain, Method),
+ ServerInfo, Active,
MsgID, MaxOutstanding, RunTime).
stop(Pid) ->