aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/ranch_transport.asciidoc
diff options
context:
space:
mode:
authorj.uhlig <[email protected]>2018-06-26 17:07:13 +0200
committerLoïc Hoguin <[email protected]>2018-07-02 09:02:00 +0200
commit5ada450fe10a5fc51b7f3f0900571a10547635a1 (patch)
tree45ac84215485f09ebedce319121ed5f719b30493 /doc/src/manual/ranch_transport.asciidoc
parentcaeadc82615e9e5ce0c2d92f882cad7b9cb7322d (diff)
downloadranch-5ada450fe10a5fc51b7f3f0900571a10547635a1.tar.gz
ranch-5ada450fe10a5fc51b7f3f0900571a10547635a1.tar.bz2
ranch-5ada450fe10a5fc51b7f3f0900571a10547635a1.zip
Introduce Transport:handshake/1,2
This commit deprecates Transport:accept_ack/1 in favor of a new forward-compatible function. Transport:handshake/1,2 will use ssl:handshake/2,3 from Ranch 2.0 onward.
Diffstat (limited to 'doc/src/manual/ranch_transport.asciidoc')
-rw-r--r--doc/src/manual/ranch_transport.asciidoc28
1 files changed, 15 insertions, 13 deletions
diff --git a/doc/src/manual/ranch_transport.asciidoc b/doc/src/manual/ranch_transport.asciidoc
index cbcea42..ed0ad70 100644
--- a/doc/src/manual/ranch_transport.asciidoc
+++ b/doc/src/manual/ranch_transport.asciidoc
@@ -26,22 +26,10 @@ Timeout = timeout():: Accept timeout.
Accept a connection on the given listening socket.
-The `accept_ack` callback will be used to initialize the socket
+The `handshake` callback will be used to initialize the socket
after accepting the connection. This is most useful when the
transport is not raw TCP, like with SSL for example.
-=== accept_ack(CSocket, Timeout) -> ok
-
-CSocket = any():: Socket for this connection.
-Timeout = timeout():: Ack timeout.
-
-Perform post-accept initialization of the connection.
-
-This function will be called by connection processes
-before performing any socket operation. It allows
-transports that require extra initialization to perform
-their task and make the socket ready to use.
-
=== close(Socket) -> ok
Socket = any():: Socket opened with listen/1 or accept/2.
@@ -60,6 +48,20 @@ perform operations on the socket, and that will receive
messages from the socket when active mode is used. When
the controlling process dies, the socket is closed.
+=== handshake(CSocket0, Options, Timeout) -> {ok, CSocket1}
+
+CSocket0 = any():: Uninitialized socket for this connection.
+Options = any():: Options for initialization.
+Timeout = timeout():: Handshake timeout.
+CSocket1 = any():: Initialized socket for this connection.
+
+Perform post-accept initialization of the connection.
+
+This function will be called by connection processes
+before performing any socket operation. It allows
+transports that require extra initialization to perform
+their task and return a socket that is ready to use.
+
=== listen(TransOpts) -> {ok, LSocket} | {error, atom()}
TransOpts = any():: Transport options.