aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranch.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/ranch.erl')
-rw-r--r--src/ranch.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ranch.erl b/src/ranch.erl
index 9cd3809..287b1e3 100644
--- a/src/ranch.erl
+++ b/src/ranch.erl
@@ -22,6 +22,8 @@
-export([child_spec/5]).
-export([child_spec/6]).
-export([accept_ack/1]).
+-export([handshake/1]).
+-export([handshake/2]).
-export([remove_connection/1]).
-export([get_status/1]).
-export([get_addr/1]).
@@ -166,10 +168,20 @@ child_spec(Ref, NumAcceptors, Transport, TransOpts, Protocol, ProtoOpts)
-spec accept_ack(ref()) -> ok.
accept_ack(Ref) ->
- receive {shoot, Ref, Transport, Socket, AckTimeout} ->
+ receive {handshake, Ref, Transport, Socket, AckTimeout} ->
Transport:accept_ack(Socket, AckTimeout)
end.
+-spec handshake(ref()) -> {ok, ranch_transport:socket()}.
+handshake(Ref) ->
+ handshake(Ref, []).
+
+-spec handshake(ref(), any()) -> {ok, ranch_transport:socket()}.
+handshake(Ref, Opts) ->
+ receive {handshake, Ref, Transport, Socket, AckTimeout} ->
+ Transport:handshake(Socket, Opts, AckTimeout)
+ end.
+
-spec remove_connection(ref()) -> ok.
remove_connection(Ref) ->
ConnsSup = ranch_server:get_connections_sup(Ref),