aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_ssl_transport.erl
diff options
context:
space:
mode:
authorAndrew Thompson <[email protected]>2012-04-06 13:14:54 -0400
committerAndrew Thompson <[email protected]>2012-04-06 13:24:02 -0400
commit06a2d636bce7a0494b960eae574fc092d25fcd7a (patch)
treecfbf0b5a432ca68cd3688a4bab7263da03f35c4e /src/cowboy_ssl_transport.erl
parent95e05d822f46e791a919f4e966879b4827989669 (diff)
downloadcowboy-06a2d636bce7a0494b960eae574fc092d25fcd7a.tar.gz
cowboy-06a2d636bce7a0494b960eae574fc092d25fcd7a.tar.bz2
cowboy-06a2d636bce7a0494b960eae574fc092d25fcd7a.zip
Add sockname/1 to the TCP and SSL transports
Diffstat (limited to 'src/cowboy_ssl_transport.erl')
-rw-r--r--src/cowboy_ssl_transport.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cowboy_ssl_transport.erl b/src/cowboy_ssl_transport.erl
index 8074209..3b130f0 100644
--- a/src/cowboy_ssl_transport.erl
+++ b/src/cowboy_ssl_transport.erl
@@ -24,7 +24,7 @@
%% @see ssl
-module(cowboy_ssl_transport).
-export([name/0, messages/0, listen/1, accept/2, recv/3, send/2, setopts/2,
- controlling_process/2, peername/1, close/1]).
+ controlling_process/2, peername/1, close/1, sockname/1]).
%% @doc Name of this transport API, <em>ssl</em>.
-spec name() -> ssl.
@@ -140,6 +140,13 @@ peername(Socket) ->
close(Socket) ->
ssl:close(Socket).
+%% @doc Get the local address and port of a socket
+%% @see ssl:sockname/1
+-spec sockname(ssl:sslsocket())
+ -> {ok, {inet:ip_address(), inet:port_number()}} | {error, atom()}.
+sockname(Socket) ->
+ ssl:sockname(Socket).
+
%% Internal.
-spec require(list(module())) -> ok.