packet and packet_size options in dlls socket

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

packet and packet_size options in dlls socket

Joe K
Why is `packet` one of the default options here

  default_inet_values() ->
    [{active, true}, {mode, list}, {packet, 0}, {packet_size, 0}].

But is then prohibited here

  emulated_options([{packet, _} = Opt | _], _, _) ->
    throw({error, {options, {not_supported, Opt}}});

Same for `packet_size` option.



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: packet and packet_size options in dlls socket

Jesper Louis Andersen-2
Pure guess:

Because UDP is an unreliable protocol and thus has no support for the "packet" option (whereas TCP does). My guess is that {packet, 0} has no real effect in the default option list. 

On Sat, Dec 30, 2017 at 6:52 PM Joe K <[hidden email]> wrote:
Why is `packet` one of the default options here

  default_inet_values() ->
    [{active, true}, {mode, list}, {packet, 0}, {packet_size, 0}].

But is then prohibited here

  emulated_options([{packet, _} = Opt | _], _, _) ->
    throw({error, {options, {not_supported, Opt}}});

Same for `packet_size` option.


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: packet and packet_size options in dlls socket

Ingela Andin
In reply to this post by Joe K
Hi!

Jesper is correct about the reason it is not supported for DTLS, that is UDP is unreliable. Reason for setting the options to defult {packet, 0}, {packet_size, 0} (e.i. no packet) is that general code in ssl_connection handles both TLS and DTLS data.

Regards Ingela Erlang/OTP Team - Ericsson AB

2017-12-30 18:52 GMT+01:00 Joe K <[hidden email]>:
Why is `packet` one of the default options here

  default_inet_values() ->
    [{active, true}, {mode, list}, {packet, 0}, {packet_size, 0}].

But is then prohibited here

  emulated_options([{packet, _} = Opt | _], _, _) ->
    throw({error, {options, {not_supported, Opt}}});

Same for `packet_size` option.



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: packet and packet_size options in dlls socket

Joe K
Thanks, Ingela. I was just wondering why the these options exist if they are forbidden. Now I understand.

On Tue, Jan 2, 2018 at 3:16 PM, Ingela Andin <[hidden email]> wrote:
Hi!

Jesper is correct about the reason it is not supported for DTLS, that is UDP is unreliable. Reason for setting the options to defult {packet, 0}, {packet_size, 0} (e.i. no packet) is that general code in ssl_connection handles both TLS and DTLS data.

Regards Ingela Erlang/OTP Team - Ericsson AB

2017-12-30 18:52 GMT+01:00 Joe K <[hidden email]>:
Why is `packet` one of the default options here

  default_inet_values() ->
    [{active, true}, {mode, list}, {packet, 0}, {packet_size, 0}].

But is then prohibited here

  emulated_options([{packet, _} = Opt | _], _, _) ->
    throw({error, {options, {not_supported, Opt}}});

Same for `packet_size` option.



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions