Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:26
erlang
3184-esock-test-sctp-Add-another-stream-SCTP-te...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 3184-esock-test-sctp-Add-another-stream-SCTP-test-case.patch of Package erlang
From 90f84cefdf413b8dda8febde9ad71ff8ff0a4c8f Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Thu, 23 May 2024 10:26:30 +0200 Subject: [PATCH 04/10] [esock|test|sctp] Add another (stream) SCTP test case Add a PRELLIMINARY IPv6 API async test case --- lib/kernel/test/socket_SUITE.erl | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/lib/kernel/test/socket_SUITE.erl b/lib/kernel/test/socket_SUITE.erl index 05d0234091..6407fa63f3 100644 --- a/lib/kernel/test/socket_SUITE.erl +++ b/lib/kernel/test/socket_SUITE.erl @@ -190,6 +190,7 @@ api_a_send_and_recv_tcp4/1, api_a_send_and_recv_tcp6/1, api_a_send_and_recv_sctp4/1, + api_a_send_and_recv_sctp6/1, api_a_sendmsg_and_recvmsg_tcp4/1, api_a_sendmsg_and_recvmsg_tcp6/1, api_a_recvfrom_cancel_udp4/1, @@ -1084,6 +1085,7 @@ api_async_cases() -> api_a_send_and_recv_tcp4, api_a_send_and_recv_tcp6, api_a_send_and_recv_sctp4, + api_a_send_and_recv_sctp6, api_a_sendmsg_and_recvmsg_tcp4, api_a_sendmsg_and_recvmsg_tcp6, api_a_recvfrom_cancel_udp4, @@ -9254,6 +9256,39 @@ api_a_send_and_recv_sctp4(Config) when is_list(Config) -> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% Basically send and receive using the "common" functions (send and recv) +%% on an IPv4 SCTP (stream) socket. But we try to be async. That is, we use +%% the 'nowait' value for the Timeout argument (and await the eventual +%% select message). Note that we only do this for the recv, +%% since its much more difficult to "arrange" for send. +%% We *also* test async for accept. +api_a_send_and_recv_sctp6(Config) when is_list(Config) -> + ?TT(?SECS(10)), + Nowait = nowait(Config), + tc_try(?FUNCTION_NAME, + fun() -> + has_support_sctp(), + has_support_ipv6() + end, + fun() -> + Send = fun(Sock, Data) -> + socket:send(Sock, Data) + end, + Recv = fun(Sock) -> + socket:recv(Sock, 0, Nowait) + end, + InitState = #{domain => inet6, + proto => sctp, + send => Send, + recv => Recv, + recv_sref => Nowait}, + ok = api_a_send_and_recv_stream(Config, InitState) + end). + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Basically send and receive using the msg functions (sendmsg and recvmsg) -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor