aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cowboy_ssl_transport.erl5
-rw-r--r--src/cowboy_tcp_transport.erl9
2 files changed, 11 insertions, 3 deletions
diff --git a/src/cowboy_ssl_transport.erl b/src/cowboy_ssl_transport.erl
index ec0f8c8..4db2008 100644
--- a/src/cowboy_ssl_transport.erl
+++ b/src/cowboy_ssl_transport.erl
@@ -13,7 +13,7 @@
%% OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-module(cowboy_ssl_transport).
--export([name/0, listen/1, accept/1, recv/3, send/2, setopts/2,
+-export([name/0, messages/0, listen/1, accept/1, recv/3, send/2, setopts/2,
controlling_process/2, peername/1, close/1]). %% API.
-include("include/types.hrl").
@@ -23,6 +23,9 @@
-spec name() -> ssl.
name() -> ssl.
+-spec messages() -> {ssl, ssl_closed, ssl_error}.
+messages() -> {ssl, ssl_closed, ssl_error}.
+
-spec listen([{port, Port::port_number()} | {certfile, CertPath::string()}
| {keyfile, KeyPath::string()} | {password, Password::string()}])
-> {ok, LSocket::socket()} | {error, Reason::posix()}.
diff --git a/src/cowboy_tcp_transport.erl b/src/cowboy_tcp_transport.erl
index 5bc80fe..c1aeabc 100644
--- a/src/cowboy_tcp_transport.erl
+++ b/src/cowboy_tcp_transport.erl
@@ -13,14 +13,19 @@
%% OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-module(cowboy_tcp_transport).
--export([name/0, listen/1, accept/1, recv/3, send/2, setopts/2,
- controlling_process/2, peername/1, close/1]).
+-export([name/0, messages/0, listen/1, accept/1, recv/3, send/2, setopts/2,
+ controlling_process/2, peername/1, close/1]). %% API.
-include("include/types.hrl").
+%% API.
+
-spec name() -> tcp.
name() -> tcp.
+-spec messages() -> {tcp, tcp_closed, tcp_error}.
+messages() -> {tcp, tcp_closed, tcp_error}.
+
-spec listen([{port, Port::port_number()}])
-> {ok, LSocket::socket()} | {error, Reason::posix()}.
listen(Opts) ->