aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/socket_server.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kernel/test/socket_server.erl')
-rw-r--r--lib/kernel/test/socket_server.erl27
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/kernel/test/socket_server.erl b/lib/kernel/test/socket_server.erl
index 23f30a0d03..a9b4aca5f8 100644
--- a/lib/kernel/test/socket_server.erl
+++ b/lib/kernel/test/socket_server.erl
@@ -187,14 +187,21 @@ do_manager_init(Domain, seqpacket = Type, sctp = Proto, _Peek) ->
{ok, Sock} ->
i("(sctp) socket opened: "
"~n ~p", [Sock]),
- F = fun(_Desc, Expect, Expect) ->
- Expect;
- (Desc, Expect, Actual) ->
- e("Unexpected result ~w: "
- "~n Expect: ~p"
- "~n Actual: ~p", [Desc, Expect, Actual]),
- exit({Desc, Expect, Actual})
- end,
+ EXP = fun(_Desc, Expect, Expect) ->
+ Expect;
+ (Desc, Expect, Actual) ->
+ e("Unexpected result ~w: "
+ "~n Expect: ~p"
+ "~n Actual: ~p", [Desc, Expect, Actual]),
+ exit({Desc, Expect, Actual})
+ end,
+ GO = fun(O) -> case socket:getopt(Sock, sctp, O) of
+ {ok, V} -> f("~p", [V]);
+ {error, R} -> f("error: ~p", [R])
+ end
+ end,
+ i("Miscellaneous options: "
+ "~n disable-fragments: ~s", [GO(disable_fragments)]),
Events = #{data_in => true,
association => true,
address => true,
@@ -205,8 +212,8 @@ do_manager_init(Domain, seqpacket = Type, sctp = Proto, _Peek) ->
adaptation_layer => true,
authentication => true,
sender_dry => true},
- F(set_sctp_events, ok, socket:setopt(Sock, sctp, events, Events)),
- F(close_socket, ok, socket:close(Sock));
+ EXP(set_sctp_events, ok, socket:setopt(Sock, sctp, events, Events)),
+ EXP(close_socket, ok, socket:close(Sock));
{error, Reason} ->
exit({failed_open, Reason})
end.