socket argument for ssl_connection:socket_control

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

socket argument for ssl_connection:socket_control

Joe K
Why is socket not a port, but a tuple for dtls_connection?

https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_connection.erl#L164

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

Re: socket argument for ssl_connection:socket_control

Danil Zagoskin-2
Hi!

It's because a socket in ssl app (TLS, DTLS) is an Erlang process.
Port is used internally only for TCP/UDP transport, and higher-level operations (handshake, encoding, decoding, etc.) are performed by a dedicated worker written in Erlang.
A tuple you see is needed to identify that worker. It also contains some other data, but the main part is the worker pid.

On Sun, Dec 31, 2017 at 4:41 PM, Joe K <[hidden email]> wrote:
Why is socket not a port, but a tuple for dtls_connection?

https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_connection.erl#L164

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




--
Danil Zagoskin | [hidden email]

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

Re: socket argument for ssl_connection:socket_control

Joe K
Thanks, Danil!

On Sun, Dec 31, 2017 at 5:57 PM, Danil Zagoskin <[hidden email]> wrote:
Hi!

It's because a socket in ssl app (TLS, DTLS) is an Erlang process.
Port is used internally only for TCP/UDP transport, and higher-level operations (handshake, encoding, decoding, etc.) are performed by a dedicated worker written in Erlang.
A tuple you see is needed to identify that worker. It also contains some other data, but the main part is the worker pid.

On Sun, Dec 31, 2017 at 4:41 PM, Joe K <[hidden email]> wrote:
Why is socket not a port, but a tuple for dtls_connection?

https://github.com/erlang/otp/blob/master/lib/ssl/src/ssl_connection.erl#L164

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




--
Danil Zagoskin | [hidden email]


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