diff options
author | Ingela Anderton Andin <[email protected]> | 2017-03-08 10:42:24 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2017-03-08 10:42:24 +0100 |
commit | b1b8a8d5f60de105371d17fefcb4812887250ff9 (patch) | |
tree | 47888be06e5eb3c5ebe70bf2dc9b394c337bcfc5 /lib/ssl/src/dtls_socket.erl | |
parent | d2e05787454aebc8406a2f781b2648c552019763 (diff) | |
parent | 98ecac283f87e02e7916a402043a3bd518fc25be (diff) | |
download | otp-b1b8a8d5f60de105371d17fefcb4812887250ff9.tar.gz otp-b1b8a8d5f60de105371d17fefcb4812887250ff9.tar.bz2 otp-b1b8a8d5f60de105371d17fefcb4812887250ff9.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/ssl/src/dtls_socket.erl')
-rw-r--r-- | lib/ssl/src/dtls_socket.erl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/ssl/src/dtls_socket.erl b/lib/ssl/src/dtls_socket.erl index 570b3ae83a..ac1a7b37c6 100644 --- a/lib/ssl/src/dtls_socket.erl +++ b/lib/ssl/src/dtls_socket.erl @@ -71,11 +71,14 @@ connect(Address, Port, #config{transport_info = {Transport, _, _, _} = CbInfo, close(gen_udp, {_Client, _Socket}) -> ok. +socket(Pid, gen_udp = Transport, {{_, _}, Socket}, ConnectionCb) -> + #sslsocket{pid = Pid, + %% "The name "fd" is keept for backwards compatibility + fd = {Transport, Socket, ConnectionCb}}; socket(Pid, Transport, Socket, ConnectionCb) -> #sslsocket{pid = Pid, %% "The name "fd" is keept for backwards compatibility - fd = {Transport, Socket, ConnectionCb}}. - + fd = {Transport, Socket, ConnectionCb}}. %% Vad göra med emulerade setopts(gen_udp, #sslsocket{pid = {Socket, _}}, Options) -> {SockOpts, _} = tls_socket:split_options(Options), @@ -108,11 +111,15 @@ getstat(gen_udp, {_,Socket}, Options) -> inet:getstat(Socket, Options); getstat(Transport, Socket, Options) -> Transport:getstat(Socket, Options). +peername(udp, _) -> + {error, enotconn}; peername(gen_udp, {_, {Client, _Socket}}) -> {ok, Client}; peername(Transport, Socket) -> Transport:peername(Socket). -sockname(gen_udp, {_,Socket}) -> +sockname(gen_udp, {_, {_,Socket}}) -> + inet:sockname(Socket); +sockname(gen_udp, Socket) -> inet:sockname(Socket); sockname(Transport, Socket) -> Transport:sockname(Socket). |