diff options
author | Loïc Hoguin <[email protected]> | 2015-12-23 12:00:08 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2016-06-09 10:04:06 +0200 |
commit | 84fd2c325c9e38b5ea2307b6133c3d15b33a3241 (patch) | |
tree | ff12089d8cd97a8a9a709af24c90233fe0a8fafa /lib/ssl/src/ssl_socket.erl | |
parent | 26a79bc4e9b399e326238ff74db0ee99a654352d (diff) | |
download | otp-84fd2c325c9e38b5ea2307b6133c3d15b33a3241.tar.gz otp-84fd2c325c9e38b5ea2307b6133c3d15b33a3241.tar.bz2 otp-84fd2c325c9e38b5ea2307b6133c3d15b33a3241.zip |
Add ssl:getstat/1 and ssl:getstat/2
These functions call getstat on the underlying TCP socket.
The only way to do this before now was to use a hack, either
by looking inside the #sslsocket{} record directly, or by
not using the SSL listen/accept functions and upgrading
from a TCP socket that is kept around for the purpose of
calling getstat later on.
Diffstat (limited to 'lib/ssl/src/ssl_socket.erl')
-rw-r--r-- | lib/ssl/src/ssl_socket.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl_socket.erl b/lib/ssl/src/ssl_socket.erl index 95a70a4602..b2aea2ba9c 100644 --- a/lib/ssl/src/ssl_socket.erl +++ b/lib/ssl/src/ssl_socket.erl @@ -24,7 +24,7 @@ -include("ssl_internal.hrl"). -include("ssl_api.hrl"). --export([socket/5, setopts/3, getopts/3, peername/2, sockname/2, port/2]). +-export([socket/5, setopts/3, getopts/3, getstat/3, peername/2, sockname/2, port/2]). -export([emulated_options/0, internal_inet_values/0, default_inet_values/0, init/1, start_link/3, terminate/2, inherit_tracker/3, get_emulated_opts/1, set_emulated_opts/2, get_all_opts/1, handle_call/3, handle_cast/2, @@ -74,6 +74,11 @@ getopts(gen_tcp, Socket, Options) -> getopts(Transport, Socket, Options) -> Transport:getopts(Socket, Options). +getstat(gen_tcp, Socket, Options) -> + inet:getstat(Socket, Options); +getstat(Transport, Socket, Options) -> + Transport:getstat(Socket, Options). + peername(gen_tcp, Socket) -> inet:peername(Socket); peername(Transport, Socket) -> |