From 7a5b320b5bb5ec45b21839005e8538172908fb57 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 19 Jul 2018 16:39:13 +0200 Subject: [socket-nif] Add (partial) support for socket (level sctp) option associnfo Added support for the SCTP option ASSOCINFO. This option is a bit tricky. As the underlying structure (sctp_assocparams) contains the assoc_id, it begs the question what happens if this option is fetched for: * The own assoc (which means that we might have the assoc id in the descriptor and can initiate that part of the struct accordningly). * Another assoc: From assoc A asks for info with assoc_id set to that of assoc B. * The "owning" endpoint. * Another endpoint (an endpoint to which the assoc does not belong). So, if the user calls socket:[getopt|setopt] for an association socket, shall we require that the assoc_id field is set to -1? Or not set at all and therefor filled in automatically by the nif-code? And, if the user calls socket:[getopt|setopt] for an endpoint socket, shall we require that the assoc_id field is set to a valid id? Or shall it not be allowed? Questions, questions... OTP-14831 --- lib/kernel/test/socket_server.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/kernel/test/socket_server.erl b/lib/kernel/test/socket_server.erl index a9b4aca5f8..56200e0ae9 100644 --- a/lib/kernel/test/socket_server.erl +++ b/lib/kernel/test/socket_server.erl @@ -200,8 +200,14 @@ do_manager_init(Domain, seqpacket = Type, sctp = Proto, _Peek) -> {error, R} -> f("error: ~p", [R]) end end, + %% ok = socket:setopt(Sock, otp, debug, true), i("Miscellaneous options: " - "~n disable-fragments: ~s", [GO(disable_fragments)]), + "~n associnfo: ~s" + "~n autoclose: ~s" + "~n disable-fragments: ~s", + [GO(associnfo), + GO(autoclose), + GO(disable_fragments)]), Events = #{data_in => true, association => true, address => true, -- cgit v1.2.3