Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:26
erlang
2464-Send-I-O-vector-with-inet_drv-instead.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2464-Send-I-O-vector-with-inet_drv-instead.patch of Package erlang
From 9f92f9a9a5a9a1315b6f41d0050b331eed9f1918 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen <raimo@erlang.org> Date: Thu, 8 Feb 2024 16:52:36 +0100 Subject: [PATCH 14/14] Send I/O vector with inet_drv instead --- lib/kernel/test/gen_tcp_socket_SUITE.erl | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/kernel/test/gen_tcp_socket_SUITE.erl b/lib/kernel/test/gen_tcp_socket_SUITE.erl index 8a7cadb18c..ce29ad7e03 100644 --- a/lib/kernel/test/gen_tcp_socket_SUITE.erl +++ b/lib/kernel/test/gen_tcp_socket_SUITE.erl @@ -65,6 +65,7 @@ testcases(direct) -> init_per_suite(Config) -> case socket:is_supported(protocols, tcp) of true -> + ct:pal("socket:info():~n ~p~n", [socket:info()]), {ok, BindAddr} = kernel_test_lib:which_local_addr(?DOMAIN), [{bind_addr, #{ family => ?DOMAIN, addr => BindAddr }} | Config]; @@ -73,6 +74,7 @@ init_per_suite(Config) -> end. end_per_suite(_Config) -> + ct:pal("socket:info():~n ~p~n", [socket:info()]), ok. @@ -202,17 +204,18 @@ run_xfer( spawn_opt( fun () -> try - {ok, L} = socket:open(?DOMAIN, stream, tcp), - ok = socket:bind(L, BindAddr), - ok = socket:listen(L), - {ok, Sockaddr} = socket:sockname(L), - Parent ! {Tag, Sockaddr}, - {ok, A} = socket:accept(L), - ok = socket:setopt(A, {socket,sndbuf}, 2 bsl K), %% Send an iovec efficiently - ok = socket:sendmsg(A, #{iov => Iovec}), - ok = socket:close(L), - ok = socket:close(A) + {ok, L} = + gen_tcp:listen( + 0, [{ifaddr,BindAddr}, {sndbuf, 2 bsl K}]), + {ok, {IP,Port}} = inet:sockname(L), + Sockaddr = + #{family => inet, addr => IP, port => Port}, + Parent ! {Tag, Sockaddr}, + {ok, A} = gen_tcp:accept(L), + ok = gen_tcp:close(L), + ok = gen_tcp:send(A, Iovec), + ok = gen_tcp:close(A) catch Class : Reason : Stacktrace -> ct:pal( "Sender crash [~w] ~w : ~p~n ~p~n", -- 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