Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
0103-kernel-gen-tcp-socket-api-test-Adjusted-th...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0103-kernel-gen-tcp-socket-api-test-Adjusted-the-t-recv-d.patch of Package erlang
From 91cbcd971b5de0f08ff06f435360b98c014c9aa3 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Wed, 24 Mar 2021 18:29:05 +0100 Subject: [PATCH 3/3] [kernel|gen-tcp-socket|api-test] Adjusted the 't recv delim' test case Added an active (=2) section also. OTP-17156 --- lib/kernel/test/gen_tcp_api_SUITE.erl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl index c216886546..739eac04bf 100644 --- a/lib/kernel/test/gen_tcp_api_SUITE.erl +++ b/lib/kernel/test/gen_tcp_api_SUITE.erl @@ -389,15 +389,29 @@ do_recv_delim(Config) -> [{active,false}, {packet,line}, {line_delimiter,$X}], {ok, Client} = gen_tcp:connect(localhost, Port, Opts), {ok, A} = gen_tcp:accept(L), + ?P("send the data"), ok = gen_tcp:send(A, "abcXefgX"), + %% Why do we need a timeout? %% Sure, normally there would be no delay, %% but this testcase has nothing to do with timeouts? ?P("read the first chunk"), - {ok, "abcX"} = gen_tcp:recv(Client, 0), %, 200), + {ok, "abcX"} = gen_tcp:recv(Client, 0), % 200), ?P("read the first chunk"), - {ok, "efgX"} = gen_tcp:recv(Client, 0), %, 200), + {ok, "efgX"} = gen_tcp:recv(Client, 0), % 200), + + ?P("set active = 2"), + ok = inet:setopts(Client, [{active,2}]), + + ?P("send the data again"), + ok = gen_tcp:send(A, "abcXefgX"), + + ?P("await the first chunk"), + receive {tcp, Client, "abcX"} -> ?P("received first chunck") end, + ?P("await the second chunk"), + receive {tcp, Client, "efgX"} -> ?P("received second chunck") end, + ?P("cleanup"), ok = gen_tcp:close(Client), ok = gen_tcp:close(A), -- 2.26.2
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