| 1 |
= ranch:handshake_continue(3) |
| 2 |
|
| 3 |
== Name |
| 4 |
|
| 5 |
ranch:handshake_continue - Resume the paused transport handshake |
| 6 |
|
| 7 |
== Description |
| 8 |
|
| 9 |
[source,erlang] |
| 10 |
---- |
| 11 |
handshake_continue(Ref) -> {ok, Socket} |
| 12 |
handshake_continue(Ref, Opts) -> {ok, Socket} |
| 13 |
|
| 14 |
Ref :: ranch:ref() |
| 15 |
Opts :: any() |
| 16 |
Socket :: any() |
| 17 |
---- |
| 18 |
|
| 19 |
Resume the paused transport handshake. |
| 20 |
|
| 21 |
This function must be called by the protocol process in order |
| 22 |
to resume a paused handshake. |
| 23 |
|
| 24 |
== Arguments |
| 25 |
|
| 26 |
Ref:: |
| 27 |
|
| 28 |
The listener name. |
| 29 |
|
| 30 |
Opts:: |
| 31 |
|
| 32 |
Transport handshake options. |
| 33 |
+ |
| 34 |
Allowed options depend on the transport module. |
| 35 |
|
| 36 |
== Return value |
| 37 |
|
| 38 |
An `ok` tuple is returned containing the socket for the connection. |
| 39 |
|
| 40 |
This function will trigger an exception when an error occurs. |
| 41 |
|
| 42 |
== Changelog |
| 43 |
|
| 44 |
* *2.0*: Function introduced. |
| 45 |
|
| 46 |
== Examples |
| 47 |
|
| 48 |
.Continue a paused transport handshake |
| 49 |
[source,erlang] |
| 50 |
---- |
| 51 |
start_link(Ref, Transport, Opts) -> |
| 52 |
Pid = proc_lib:spawn_link(?MODULE, init, |
| 53 |
[Ref, Transport, Opts]), |
| 54 |
{ok, Pid}. |
| 55 |
|
| 56 |
init(Ref, Transport, Opts) -> |
| 57 |
{continue, _Info} = ranch:handshake(Ref), |
| 58 |
{ok, Socket} = ranch:handshake_continue(Ref), |
| 59 |
loop(#state{ref=Ref, socket=Socket, |
| 60 |
transport=Transport, opts=Opts}). |
| 61 |
---- |
| 62 |
|
| 63 |
== See also |
| 64 |
|
| 65 |
link:man:ranch:handshake(3)[ranch:handshake(3)], |
| 66 |
link:man:ranch:handshake_cancel(3)[ranch:handshake_cancel(3)], |
| 67 |
link:man:ranch(3)[ranch(3)] |