aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2018-12-07 18:40:24 +0100
committerMicael Karlberg <[email protected]>2018-12-07 18:43:00 +0100
commitd0c3f79d22b4778f66ac1d8a2fc03e736f42e973 (patch)
treefee37591fb85039583e58858ade959d0de360142 /erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
parentc5378517cccf29d1708c71a0949664605743b478 (diff)
downloadotp-d0c3f79d22b4778f66ac1d8a2fc03e736f42e973.tar.gz
otp-d0c3f79d22b4778f66ac1d8a2fc03e736f42e973.tar.bz2
otp-d0c3f79d22b4778f66ac1d8a2fc03e736f42e973.zip
[socket-nif|test] ttest improvements
Added a ttest lib module for some common functions. Added a process (server handler and reader processes) stats printouts. So far only used by the server. There is still a "leak". Its a term leak. Some of the functions take a ref as argument (recv, send and accept for instance). This is stored internally, by way of a call to the enif_make_copy, in order to be used later in a select call. Its not "released" though, until the environment is released, which happens when the socket dtor callback function is called. Possible solution: We need to keep "temporary" environments (one for each of the queues), which we can clear (basically we need two, one that is currently used for new ref's and one for the old ref's). OTP-14831
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.erl15
1 files changed, 8 insertions, 7 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 0d2ec38876..ef980e8d32 100644
--- a/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
+++ b/erts/emulator/test/socket_test_ttest_tcp_client_socket.erl
@@ -21,23 +21,24 @@
-module(socket_test_ttest_tcp_client_socket).
-export([
- start_monitor/3, start_monitor/4, start_monitor/6,
+ start_monitor/4, start_monitor/5, start_monitor/7,
stop/1
]).
-define(TRANSPORT_MOD, socket_test_ttest_tcp_socket).
+-define(MOD(M), {?TRANSPORT_MOD, #{method => Method}}).
-start_monitor(Active, Addr, Port) ->
- socket_test_ttest_tcp_client:start_monitor(?TRANSPORT_MOD,
+start_monitor(Method, Active, Addr, Port) ->
+ socket_test_ttest_tcp_client:start_monitor(?MOD(Method),
Active, Addr, Port).
-start_monitor(Active, Addr, Port, MsgID) ->
- socket_test_ttest_tcp_client:start_monitor(?TRANSPORT_MOD,
+start_monitor(Method, Active, Addr, Port, MsgID) ->
+ socket_test_ttest_tcp_client:start_monitor(?MOD(Method),
Active, Addr, Port,
MsgID).
-start_monitor(Active, Addr, Port, MsgID, MaxOutstanding, RunTime) ->
- socket_test_ttest_tcp_client:start_monitor(?TRANSPORT_MOD,
+start_monitor(Method, Active, Addr, Port, MsgID, MaxOutstanding, RunTime) ->
+ socket_test_ttest_tcp_client:start_monitor(?MOD(Method),
Active, Addr, Port,
MsgID, MaxOutstanding, RunTime).