diff options
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/test/socket_SUITE.erl | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/erts/emulator/test/socket_SUITE.erl b/erts/emulator/test/socket_SUITE.erl index aecd65096e..5a02f7904e 100644 --- a/erts/emulator/test/socket_SUITE.erl +++ b/erts/emulator/test/socket_SUITE.erl @@ -87,7 +87,7 @@ api_a_send_and_recv_tcp4/1, api_a_sendmsg_and_recvmsg_tcp4/1, api_a_recvfrom_cancel_udp4/1, - %% api_a_recvmsg_cancel_udp4/1, + api_a_recvmsg_cancel_udp4/1, %% api_a_accept_cancel_tcp4/1, %% api_a_recv_cancel_tcp4/1, %% api_a_recvmsg_cancel_tcp4/1, @@ -678,8 +678,8 @@ api_async_cases() -> api_a_sendmsg_and_recvmsg_udp4, api_a_send_and_recv_tcp4, api_a_sendmsg_and_recvmsg_tcp4, - api_a_recvfrom_cancel_udp4%% , - %% api_a_recvmsg_cancel_udp4, + api_a_recvfrom_cancel_udp4, + api_a_recvmsg_cancel_udp4%%, %% api_a_accept_cancel_tcp4, %% api_a_recv_cancel_tcp4, %% api_a_recvmsg_cancel_tcp4 @@ -3722,6 +3722,34 @@ api_a_recvfrom_cancel_udp4(_Config) when is_list(_Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Basically we make an async (Timeout = nowait) call to recvmsg, +%% wait some time and then cancel. +%% +api_a_recvmsg_cancel_udp4(suite) -> + []; +api_a_recvmsg_cancel_udp4(doc) -> + []; +api_a_recvmsg_cancel_udp4(_Config) when is_list(_Config) -> + ?TT(?SECS(5)), + tc_try(api_a_recvmsg_cancel_udp4, + fun() -> + Recv = fun(Sock) -> + case socket:recvmsg(Sock, nowait) of + {ok, _} = OK -> + OK; + {error, _} = ERROR -> + ERROR + end + end, + InitState = #{domain => inet, + recv => Recv}, + ok = api_a_recv_cancel_udp(InitState) + end). + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + api_a_recv_cancel_udp(InitState) -> ServerSeq = [ |