diff options
author | Loïc Hoguin <[email protected]> | 2020-06-25 13:32:01 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2020-06-25 13:32:01 +0200 |
commit | e7feea1ec8a65311f9da998605031df77e5d26ea (patch) | |
tree | cda16ab7e1626f6d2d8819583cdc27e87247d292 /docs/en/ranch/2.0/guide/protocols | |
parent | 849fab7227a2fd1ff5fa4d603ba89037e1c462b4 (diff) | |
download | ninenines.eu-e7feea1ec8a65311f9da998605031df77e5d26ea.tar.gz ninenines.eu-e7feea1ec8a65311f9da998605031df77e5d26ea.tar.bz2 ninenines.eu-e7feea1ec8a65311f9da998605031df77e5d26ea.zip |
Ranch 2.0
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 |