diff options
Diffstat (limited to 'docs/en/ranch/2.0/guide/protocols')
-rw-r--r-- | docs/en/ranch/2.0/guide/protocols/index.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/en/ranch/2.0/guide/protocols/index.html b/docs/en/ranch/2.0/guide/protocols/index.html index 34817316..2388c2e8 100644 --- a/docs/en/ranch/2.0/guide/protocols/index.html +++ b/docs/en/ranch/2.0/guide/protocols/index.html @@ -64,7 +64,7 @@ <p>A protocol handler starts a connection process and defines the protocol logic executed in this process.</p> <h2 id="_writing_a_protocol_handler">Writing a protocol handler</h2> -<p>All protocol handlers must implement the <code>ranch_protocol</code> behavior which defines a single callback, <code>start_link/3</code>. This callback is responsible for spawning a new process for handling the connection. It receives four arguments: the name of the listener, the socket, the transport handler being used and the protocol options defined in the call to <code>ranch:start_listener/5</code>. This callback must return <code>{ok, Pid}</code>, with <code>Pid</code> the pid of the new process.</p> +<p>All protocol handlers must implement the <code>ranch_protocol</code> behavior which defines a single callback, <code>start_link/3</code>. This callback is responsible for spawning a new process for handling the connection. It receives three arguments: the name of the listener, the transport handler being used and the protocol options defined in the call to <code>ranch:start_listener/5</code>. This callback must return <code>{ok, Pid}</code>, with <code>Pid</code> the pid of the new process.</p> <p>The newly started process can then freely initialize itself. However, it must call <code>ranch:handshake/1,2</code> before doing any socket operation. This will ensure the connection process is the owner of the socket. It expects the listener's name as argument.</p> <div class="listingblock"><div class="title">Perform the socket handshake</div> <div class="content"><!-- Generator: GNU source-highlight 3.1.9 |