diff options
author | Ingela Anderton Andin <[email protected]> | 2013-02-14 10:33:44 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2013-02-14 10:33:44 +0100 |
commit | 37213d9ca054bb9ab3389de959cda58abedf9b06 (patch) | |
tree | 027d7629669719cee9deb01eb0f258f298fc2ffe /lib/ssl/src/ssl_socket.erl | |
parent | bbcf34d621d613046ea99eb5fafc01196c88e47f (diff) | |
parent | 56354fdbf817291bed0c18373c5ad8dfb639b7e6 (diff) | |
download | otp-37213d9ca054bb9ab3389de959cda58abedf9b06.tar.gz otp-37213d9ca054bb9ab3389de959cda58abedf9b06.tar.bz2 otp-37213d9ca054bb9ab3389de959cda58abedf9b06.zip |
Merge branch 'ia/ssl/transport-cb-and-inet/OTP-10847'
* ia/ssl/transport-cb-and-inet/OTP-10847:
ssl: Generalize cb_info option
Diffstat (limited to 'lib/ssl/src/ssl_socket.erl')
-rw-r--r-- | lib/ssl/src/ssl_socket.erl | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/ssl/src/ssl_socket.erl b/lib/ssl/src/ssl_socket.erl new file mode 100644 index 0000000000..4778db2333 --- /dev/null +++ b/lib/ssl/src/ssl_socket.erl @@ -0,0 +1,35 @@ +-module(ssl_socket). + +-include("ssl_internal.hrl"). + +-export([socket/3, setopts/3, getopts/3, peername/2, sockname/2, port/2]). + +socket(Pid, Transport, Socket) -> + #sslsocket{pid = Pid, + %% "The name "fd" is keept for backwards compatibility + fd = {Transport, Socket}}. + +setopts(gen_tcp, Socket, Options) -> + inet:setopts(Socket, Options); +setopts(Transport, Socket, Options) -> + Transport:setopts(Socket, Options). + +getopts(gen_tcp, Socket, Options) -> + inet:getopts(Socket, Options); +getopts(Transport, Socket, Options) -> + Transport:getopts(Socket, Options). + +peername(gen_tcp, Socket) -> + inet:peername(Socket); +peername(Transport, Socket) -> + Transport:peername(Socket). + +sockname(gen_tcp, Socket) -> + inet:sockname(Socket); +sockname(Transport, Socket) -> + Transport:sockname(Socket). + +port(gen_tcp, Socket) -> + inet:port(Socket); +port(Transport, Socket) -> + Transport:port(Socket). |