From 8459bebceb9533948193774371cbd9fd571b78ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 16 Oct 2019 09:48:31 +0200 Subject: Cowboy 2.7.0 --- docs/en/ranch/1.7/guide/embedded/index.html | 2 +- docs/en/ranch/1.7/guide/internals/index.html | 2 +- docs/en/ranch/1.7/guide/listeners/index.html | 40 +++++++++++----------- docs/en/ranch/1.7/guide/parsers/index.html | 6 ++-- docs/en/ranch/1.7/guide/protocols/index.html | 6 ++-- docs/en/ranch/1.7/guide/ssl_auth/index.html | 6 ++-- docs/en/ranch/1.7/guide/transports/index.html | 16 ++++----- docs/en/ranch/1.7/manual/index.html | 2 +- .../ranch/1.7/manual/ranch.child_spec/index.html | 4 +-- docs/en/ranch/1.7/manual/ranch.get_addr/index.html | 4 +-- .../manual/ranch.get_max_connections/index.html | 4 +-- docs/en/ranch/1.7/manual/ranch.get_port/index.html | 4 +-- .../manual/ranch.get_protocol_options/index.html | 4 +-- .../ranch/1.7/manual/ranch.get_status/index.html | 4 +-- .../manual/ranch.get_transport_options/index.html | 4 +-- .../en/ranch/1.7/manual/ranch.handshake/index.html | 4 +-- docs/en/ranch/1.7/manual/ranch.info/index.html | 6 ++-- docs/en/ranch/1.7/manual/ranch.procs/index.html | 6 ++-- .../1.7/manual/ranch.recv_proxy_header/index.html | 4 +-- .../1.7/manual/ranch.remove_connection/index.html | 4 +-- .../1.7/manual/ranch.resume_listener/index.html | 4 +-- .../manual/ranch.set_max_connections/index.html | 4 +-- .../manual/ranch.set_protocol_options/index.html | 4 +-- .../manual/ranch.set_transport_options/index.html | 4 +-- .../1.7/manual/ranch.start_listener/index.html | 8 ++--- .../1.7/manual/ranch.stop_listener/index.html | 4 +-- .../1.7/manual/ranch.suspend_listener/index.html | 4 +-- .../manual/ranch.wait_for_connections/index.html | 6 ++-- docs/en/ranch/1.7/manual/ranch/index.html | 8 ++--- docs/en/ranch/1.7/manual/ranch_app/index.html | 2 +- docs/en/ranch/1.7/manual/ranch_protocol/index.html | 2 +- .../manual/ranch_proxy_header.header/index.html | 6 ++-- .../1.7/manual/ranch_proxy_header.parse/index.html | 4 +-- .../ranch/1.7/manual/ranch_proxy_header/index.html | 2 +- docs/en/ranch/1.7/manual/ranch_ssl/index.html | 6 ++-- docs/en/ranch/1.7/manual/ranch_tcp/index.html | 4 +-- .../1.7/manual/ranch_transport.sendfile/index.html | 4 +-- .../en/ranch/1.7/manual/ranch_transport/index.html | 40 +++++++++++----------- 38 files changed, 124 insertions(+), 124 deletions(-) (limited to 'docs/en/ranch/1.7') diff --git a/docs/en/ranch/1.7/guide/embedded/index.html b/docs/en/ranch/1.7/guide/embedded/index.html index 22791d31..918de887 100644 --- a/docs/en/ranch/1.7/guide/embedded/index.html +++ b/docs/en/ranch/1.7/guide/embedded/index.html @@ -70,7 +70,7 @@

As for ranch_sup, the child spec is simple enough to not require a convenience function.

The following example adds both ranch_sup and one listener to another application's supervision tree.

Embed Ranch directly in your supervision tree
-
diff --git a/docs/en/ranch/1.7/guide/internals/index.html b/docs/en/ranch/1.7/guide/internals/index.html index 41f4403a..c69eef95 100644 --- a/docs/en/ranch/1.7/guide/internals/index.html +++ b/docs/en/ranch/1.7/guide/internals/index.html @@ -82,7 +82,7 @@

This is especially useful if you expect many connections to be mostly idle, perhaps part of a connection pool. They can be handled by the kernel directly until they send any real data, instead of allocating resources to idle connections.

To enable this mechanism, the following option can be used.

Using raw transport options
-
diff --git a/docs/en/ranch/1.7/guide/listeners/index.html b/docs/en/ranch/1.7/guide/listeners/index.html index 584ec224..5c64e2c7 100644 --- a/docs/en/ranch/1.7/guide/listeners/index.html +++ b/docs/en/ranch/1.7/guide/listeners/index.html @@ -80,7 +80,7 @@

Ranch includes both TCP and SSL transport handlers, respectively ranch_tcp and ranch_ssl.

A listener can be started by calling the ranch:start_listener/5 function. Before doing so however, you must ensure that the ranch application is started.

Starting the Ranch application
-
@@ -88,7 +88,7 @@ http://www.gnu.org/software/src-highlite -->

You are then ready to start a listener. Let's call it tcp_echo. It will have a pool of 100 acceptors, use a TCP transport and forward connections to the echo_protocol handler.

Starting a listener for TCP connections on port 5555
-
@@ -99,7 +99,7 @@ http://www.gnu.org/software/src-highlite -->

You can try this out by compiling and running the tcp_echo example in the examples directory. To do so, open a shell in the examples/tcp_echo/ directory and run the following command:

Building and starting a Ranch example
-
@@ -107,7 +107,7 @@ http://www.gnu.org/software/src-highlite -->

You can then connect to it using telnet and see the echo server reply everything you send to it. Then when you're done testing, you can use the Ctrl+] key to escape to the telnet command line and type quit to exit.

Connecting to the example listener with telnet
-
@@ -127,7 +127,7 @@ Connection closed.

Stopping a listener

All you need to stop a Ranch listener is to call the ranch:stop_listener/1 function with the listener's name as argument. In the previous section we started the listener named tcp_echo. We can now stop it.

Stopping a listener
-
@@ -137,7 +137,7 @@ http://www.gnu.org/software/src-highlite -->

Listeners can be suspended and resumed by calling ranch:suspend_listener/1 and ranch:resume_listener/1, respectively, with the name of the listener as argument.

Suspending a listener will cause it to stop listening and not accept new connections, but existing connection processes will not be stopped.

Suspending a listener
-
@@ -145,7 +145,7 @@ http://www.gnu.org/software/src-highlite -->

Resuming a listener will cause it to start listening and accept new connections again. It is worth mentioning, however, that if the listener is configured to listen on a random port, it will listen on a different port than before it was suspended.

Resuming a listener
-
@@ -159,7 +159,7 @@ http://www.gnu.org/software/src-highlite -->

You do not have to specify a specific port to listen on. If you give the port number 0, or if you omit the port number entirely, Ranch will start listening on a random port.

You can retrieve this port number by calling ranch:get_port/1. The argument is the name of the listener you gave in ranch:start_listener/5.

Starting a listener for TCP connections on a random port
-
@@ -178,7 +178,7 @@ http://www.gnu.org/software/src-highlite -->

Limiting the number of concurrent connections

The max_connections transport option allows you to limit the number of concurrent connections. It defaults to 1024. Its purpose is to prevent your system from being overloaded and ensuring all the connections are handled optimally.

Customizing the maximum number of concurrent connections
-
@@ -189,7 +189,7 @@ http://www.gnu.org/software/src-highlite -->

You can disable this limit by setting its value to the atom infinity.

Disabling the limit for the number of connections
-
@@ -203,7 +203,7 @@ http://www.gnu.org/software/src-highlite -->

You may not always want connections to be counted when checking for max_connections. For example you might have a protocol where both short-lived and long-lived connections are possible. If the long-lived connections are mostly waiting for messages, then they don't consume much resources and can safely be removed from the count.

To remove the connection from the count, you must call the ranch:remove_connection/1 from within the connection process, with the name of the listener as the only argument.

Removing a connection from the count of connections
-
@@ -212,7 +212,7 @@ http://www.gnu.org/software/src-highlite -->

As seen in the chapter covering protocols, this pid is received as the first argument of the protocol's start_link/4 callback.

You can modify the max_connections value on a running listener by using the ranch:set_max_connections/2 function, with the name of the listener as first argument and the new value as the second.

Upgrading the maximum number of connections
-
@@ -223,7 +223,7 @@ http://www.gnu.org/software/src-highlite -->

By default Ranch will use 10 acceptor processes. Their role is to accept connections and spawn a connection process for every new connection.

This number can be tweaked to improve performance. A good number is typically between 10 or 100 acceptors. You must measure to find the best value for your application.

Specifying a custom number of acceptor processes
-
@@ -246,7 +246,7 @@ Ranch acceptor reducing accept rate: out of file descriptors

Ranch allows you to upgrade the protocol options. This takes effect immediately and for all subsequent connections.

To upgrade the protocol options, call ranch:set_protocol_options/2 with the name of the listener as first argument and the new options as the second.

Upgrading the protocol options
-
@@ -255,7 +255,7 @@ http://www.gnu.org/software/src-highlite -->

All future connections will use the new options.

You can also retrieve the current options similarly by calling ranch:get_protocol_options/1.

Retrieving the current protocol options
-
@@ -265,7 +265,7 @@ http://www.gnu.org/software/src-highlite -->

Ranch allows you to change the transport options of a listener, for example to make it listen on a different port.

To change transport options, the listener has to be suspended first. Then you are allowed to change the transport options by calling ranch:set_transport_options/2 with the listener name and the new transport options as arguments. After that, you can resume the listener.

Changing the transport options
-
@@ -273,7 +273,7 @@ http://www.gnu.org/software/src-highlite -->

You can retrieve the current transport options by calling ranch:get_transport_options/1.

Retrieving the current transport options
-
@@ -283,7 +283,7 @@ http://www.gnu.org/software/src-highlite -->

Ranch provides two functions for retrieving information about the listeners, for reporting and diagnostic purposes.

The ranch:info/0 function will return detailed information about all listeners.

Retrieving detailed information
-
@@ -291,14 +291,14 @@ http://www.gnu.org/software/src-highlite -->

The ranch:procs/2 function will return all acceptor or listener processes for a given listener.

Get all acceptor processes
-
ranch:procs(tcp_echo, acceptors).
Get all connection processes
-
diff --git a/docs/en/ranch/1.7/guide/parsers/index.html b/docs/en/ranch/1.7/guide/parsers/index.html index 0eb94a03..bb2f8e0e 100644 --- a/docs/en/ranch/1.7/guide/parsers/index.html +++ b/docs/en/ranch/1.7/guide/parsers/index.html @@ -76,7 +76,7 @@

Text protocols are generally line based. This means that we can't do anything with them until we receive the full line.

A simple way to get a full line is to use binary:split/2,3.

Using binary:split/2 to get a line of input
-
@@ -90,7 +90,7 @@ http://www.gnu.org/software/src-highlite -->

In the above example, we can have two results. Either there was a line break in the buffer and we get it split into two parts, the line and the rest of the buffer; or there was no line break in the buffer and we need to get more data from the socket.

Next, we need to parse the line. The simplest way is to again split, here on space. The difference is that we want to split on all spaces character, as we want to tokenize the whole string.

Using binary:split/3 to split text
-
@@ -111,7 +111,7 @@ http://www.gnu.org/software/src-highlite -->

Sometimes the size of the frame includes the first four bytes, sometimes not. Other times this size is encoded over two bytes. And even other times little-endian is used instead of big-endian.

The general idea stays the same though.

Using binary pattern matching to split frames
-
diff --git a/docs/en/ranch/1.7/guide/protocols/index.html b/docs/en/ranch/1.7/guide/protocols/index.html index dd1b8bb3..5828dd93 100644 --- a/docs/en/ranch/1.7/guide/protocols/index.html +++ b/docs/en/ranch/1.7/guide/protocols/index.html @@ -67,7 +67,7 @@

All protocol handlers must implement the ranch_protocol behavior which defines a single callback, start_link/4. 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 ranch:start_listener/5. This callback must return {ok, Pid}, with Pid the pid of the new process.

The newly started process can then freely initialize itself. However, it must call ranch:handshake/1,2 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.

Perform the socket handshake
-
@@ -76,7 +76,7 @@ http://www.gnu.org/software/src-highlite -->

If your protocol code requires specific socket options, you should set them while initializing your connection process, after calling ranch:handshake/1,2. You can use Transport:setopts/2 for that purpose.

Following is the complete protocol code for the example found in examples/tcp_echo/.

Protocol module that echoes everything it receives
-
@@ -107,7 +107,7 @@ http://www.gnu.org/software/src-highlite -->

Special processes like the ones that use the gen_statem or gen_server behaviours have the particularity of having their start_link call not return until the init function returns. This is problematic, because you won't be able to call ranch:handshake/1,2 from the init callback as this would cause a deadlock to happen.

Use the gen_statem:enter_loop/4 function. It allows you to start your process normally (although it must be started with proc_lib like all special processes), then perform any needed operations before falling back into the normal gen_statem execution loop.

Use a gen_statem for protocol handling
-
diff --git a/docs/en/ranch/1.7/guide/ssl_auth/index.html b/docs/en/ranch/1.7/guide/ssl_auth/index.html index 20e35715..ce1891bc 100644 --- a/docs/en/ranch/1.7/guide/ssl_auth/index.html +++ b/docs/en/ranch/1.7/guide/ssl_auth/index.html @@ -90,7 +90,7 @@

Transport configuration

The SSL transport does not request a client certificate by default. You need to specify the {verify, verify_peer} option when starting the listener to enable this behavior.

Configure a listener for SSL authentication
-
@@ -109,7 +109,7 @@ http://www.gnu.org/software/src-highlite -->

Authentication

To authenticate users, you must first save the certificate information required. If you have your users' certificate files, you can simply load the certificate and retrieve the information directly.

Retrieve the issuer ID from a certificate
-
@@ -123,7 +123,7 @@ http://www.gnu.org/software/src-highlite -->

To retrieve the IssuerID from a running connection, you need to first retrieve the client certificate and then extract this information from it. Ranch does not provide a function to retrieve the client certificate. Instead you can use the ssl:peercert/1 function. Once you have the certificate, you can again use the public_key:pkix_issuer_id/2 to extract the IssuerID value.

The following function returns the IssuerID or false if no client certificate was found. This snippet is intended to be used from your protocol code.

Retrieve the issuer ID from the certificate for the current connection
-
diff --git a/docs/en/ranch/1.7/guide/transports/index.html b/docs/en/ranch/1.7/guide/transports/index.html index f7af0741..f3c97489 100644 --- a/docs/en/ranch/1.7/guide/transports/index.html +++ b/docs/en/ranch/1.7/guide/transports/index.html @@ -74,7 +74,7 @@

This section assumes that Transport is a valid transport handler (like ranch_tcp or ranch_ssl) and Socket is a connected socket obtained through the listener.

You can send data to a socket by calling the Transport:send/2 function. The data can be given as iodata(), which is defined as binary() | iolist(). All the following calls will work:

Sending data to the socket
-
@@ -88,7 +88,7 @@ http://www.gnu.org/software/src-highlite -->

Receiving data using passive mode requires a single function call. The first argument is the socket, and the third argument is a timeout duration before the call returns with {error, timeout}.

The second argument is the amount of data in bytes that we want to receive. The function will wait for data until it has received exactly this amount. If you are not expecting a precise size, you can specify 0 which will make this call return as soon as data was read, regardless of its size.

Receiving data from the socket in passive mode
-
@@ -106,7 +106,7 @@ http://www.gnu.org/software/src-highlite -->

The value of OK, Closed and Error can be different depending on the transport being used. To be able to properly match on them you must first call the Transport:messages/0 function.

Retrieving the transport's active message identifiers
-
@@ -114,7 +114,7 @@ http://www.gnu.org/software/src-highlite -->

To start receiving messages you will need to call the Transport:setopts/2 function, and do so every time you want to receive data.

Receiving messages from the socket in active mode
-
@@ -134,7 +134,7 @@ http://www.gnu.org/software/src-highlite -->

As in the previous section it is assumed Transport is a valid transport handler and Socket is a connected socket obtained through the listener.

To send a whole file, with name Filename, over a socket:

Sending a file by filename
-
@@ -142,7 +142,7 @@ http://www.gnu.org/software/src-highlite -->

Or part of a file, with Offset greater than or equal to 0, Bytes number of bytes and chunks of size ChunkSize:

Sending part of a file by filename in chunks
-
@@ -151,7 +151,7 @@ http://www.gnu.org/software/src-highlite -->

To improve efficiency when sending multiple parts of the same file it is also possible to use a file descriptor opened in raw mode:

Sending a file opened in raw mode
-
@@ -161,7 +161,7 @@ http://www.gnu.org/software/src-highlite -->

Upgrading a TCP socket to SSL

A connected TCP socket can be upgraded to a SSL socket via the function ranch_ssl:handshake/3. The socket must be in {active, false} mode before telling the client that the server is ready to upgrade in order to avoid race conditions.

Performing a TLS handshake on a TCP socket
-
diff --git a/docs/en/ranch/1.7/manual/index.html b/docs/en/ranch/1.7/manual/index.html index c1069688..17b6a287 100644 --- a/docs/en/ranch/1.7/manual/index.html +++ b/docs/en/ranch/1.7/manual/index.html @@ -91,7 +91,7 @@

All these applications must be started before the ranch application. To start Ranch and all dependencies at once:

-
diff --git a/docs/en/ranch/1.7/manual/ranch.child_spec/index.html b/docs/en/ranch/1.7/manual/ranch.child_spec/index.html index 78a31698..42ef604a 100644 --- a/docs/en/ranch/1.7/manual/ranch.child_spec/index.html +++ b/docs/en/ranch/1.7/manual/ranch.child_spec/index.html @@ -65,7 +65,7 @@

Name

ranch:child_spec - Build child specifications for a new listener

Description

-
@@ -108,7 +108,7 @@ http://www.gnu.org/software/src-highlite -->

Examples

Embed a listener
-
diff --git a/docs/en/ranch/1.7/manual/ranch.get_addr/index.html b/docs/en/ranch/1.7/manual/ranch.get_addr/index.html index 3f752903..a8ed1dd6 100644 --- a/docs/en/ranch/1.7/manual/ranch.get_addr/index.html +++ b/docs/en/ranch/1.7/manual/ranch.get_addr/index.html @@ -65,7 +65,7 @@

Name

ranch:get_addr - Get the listening port and IP

Description

-
@@ -84,7 +84,7 @@ http://www.gnu.org/software/src-highlite -->

The IP address is the IP of the network interface the socket is bound to.

Examples

Get the listening port and IP
-
diff --git a/docs/en/ranch/1.7/manual/ranch.get_max_connections/index.html b/docs/en/ranch/1.7/manual/ranch.get_max_connections/index.html index 45905c48..51ba800d 100644 --- a/docs/en/ranch/1.7/manual/ranch.get_max_connections/index.html +++ b/docs/en/ranch/1.7/manual/ranch.get_max_connections/index.html @@ -65,7 +65,7 @@

Name

ranch:get_max_connections - Get the max number of connections

Description

-
@@ -82,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->

The maximum number of connections is returned.

Examples

Get the max number of connections
-
diff --git a/docs/en/ranch/1.7/manual/ranch.get_port/index.html b/docs/en/ranch/1.7/manual/ranch.get_port/index.html index b826aeb3..d9076ffd 100644 --- a/docs/en/ranch/1.7/manual/ranch.get_port/index.html +++ b/docs/en/ranch/1.7/manual/ranch.get_port/index.html @@ -65,7 +65,7 @@

Name

ranch:get_port - Get the listening port

Description

-
@@ -83,7 +83,7 @@ http://www.gnu.org/software/src-highlite -->

The listening port is returned.

Examples

Get the listening port
-
diff --git a/docs/en/ranch/1.7/manual/ranch.get_protocol_options/index.html b/docs/en/ranch/1.7/manual/ranch.get_protocol_options/index.html index 9e8d7d88..65dbcf12 100644 --- a/docs/en/ranch/1.7/manual/ranch.get_protocol_options/index.html +++ b/docs/en/ranch/1.7/manual/ranch.get_protocol_options/index.html @@ -65,7 +65,7 @@

Name

ranch:get_protocol_options - Get the current protocol options

Description

-
@@ -82,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->

The current protocol options are returned.

Examples

Get the current protocol options
-
diff --git a/docs/en/ranch/1.7/manual/ranch.get_status/index.html b/docs/en/ranch/1.7/manual/ranch.get_status/index.html index 40ec9176..49d3b336 100644 --- a/docs/en/ranch/1.7/manual/ranch.get_status/index.html +++ b/docs/en/ranch/1.7/manual/ranch.get_status/index.html @@ -65,7 +65,7 @@

Name

ranch:get_status - Get a listener's running state

Description

-
@@ -85,7 +85,7 @@ http://www.gnu.org/software/src-highlite -->

Examples

Get a listener's running state
-
diff --git a/docs/en/ranch/1.7/manual/ranch.get_transport_options/index.html b/docs/en/ranch/1.7/manual/ranch.get_transport_options/index.html index 25871700..9786a103 100644 --- a/docs/en/ranch/1.7/manual/ranch.get_transport_options/index.html +++ b/docs/en/ranch/1.7/manual/ranch.get_transport_options/index.html @@ -65,7 +65,7 @@

Name

ranch:get_transport_options - Get the current transport options

Description

-
@@ -82,7 +82,7 @@ http://www.gnu.org/software/src-highlite -->

The current transport options are returned.

Examples

Get the current transport options
-
diff --git a/docs/en/ranch/1.7/manual/ranch.handshake/index.html b/docs/en/ranch/1.7/manual/ranch.handshake/index.html index e4121a8a..06145f4a 100644 --- a/docs/en/ranch/1.7/manual/ranch.handshake/index.html +++ b/docs/en/ranch/1.7/manual/ranch.handshake/index.html @@ -65,7 +65,7 @@

Name

ranch:handshake - Perform the transport handshake

Description

-
@@ -97,7 +97,7 @@ http://www.gnu.org/software/src-highlite -->

Examples

Initialize the connection process
-
diff --git a/docs/en/ranch/1.7/manual/ranch.info/index.html b/docs/en/ranch/1.7/manual/ranch.info/index.html index 42c8ed58..f7506d46 100644 --- a/docs/en/ranch/1.7/manual/ranch.info/index.html +++ b/docs/en/ranch/1.7/manual/ranch.info/index.html @@ -65,7 +65,7 @@

Name

ranch:info - Overview of Ranch listeners

Description

-
@@ -123,14 +123,14 @@ http://www.gnu.org/software/src-highlite -->

Examples

Get information about all listeners
-
AllInfo = ranch:info().
Get information about a specific listener
-
diff --git a/docs/en/ranch/1.7/manual/ranch.procs/index.html b/docs/en/ranch/1.7/manual/ranch.procs/index.html index d306a1ff..2bce6c1d 100644 --- a/docs/en/ranch/1.7/manual/ranch.procs/index.html +++ b/docs/en/ranch/1.7/manual/ranch.procs/index.html @@ -65,7 +65,7 @@

Name

ranch:procs - Retrieve pids from a listener

Description

-
@@ -86,14 +86,14 @@ http://www.gnu.org/software/src-highlite -->

A list of pids is returned.

Examples

Get the pids of the acceptor processes
-
Pids = ranch:procs(acceptors).
Get the pids of the connection processes
-
diff --git a/docs/en/ranch/1.7/manual/ranch.recv_proxy_header/index.html b/docs/en/ranch/1.7/manual/ranch.recv_proxy_header/index.html index e652fac6..f0b05deb 100644 --- a/docs/en/ranch/1.7/manual/ranch.recv_proxy_header/index.html +++ b/docs/en/ranch/1.7/manual/ranch.recv_proxy_header/index.html @@ -65,7 +65,7 @@

Name

ranch:recv_proxy_header - Receive the PROXY protocol header

Description

-
@@ -94,7 +94,7 @@ http://www.gnu.org/software/src-highlite -->

Examples

Receive the PROXY protocol header
-
diff --git a/docs/en/ranch/1.7/manual/ranch.remove_connection/index.html b/docs/en/ranch/1.7/manual/ranch.remove_connection/index.html index df47d1d8..540ed9a9 100644 --- a/docs/en/ranch/1.7/manual/ranch.remove_connection/index.html +++ b/docs/en/ranch/1.7/manual/ranch.remove_connection/index.html @@ -65,7 +65,7 @@

Name

ranch:remove_connection - Remove connection from the count

Description

-
@@ -83,7 +83,7 @@ http://www.gnu.org/software/src-highlite -->

The atom ok is always returned. It can be safely ignored.

Examples

Remove the connection process from the count
-
diff --git a/docs/en/ranch/1.7/manual/ranch.resume_listener/index.html b/docs/en/ranch/1.7/manual/ranch.resume_listener/index.html index f702c4f0..9aabac54 100644 --- a/docs/en/ranch/1.7/manual/ranch.resume_listener/index.html +++ b/docs/en/ranch/1.7/manual/ranch.resume_listener/index.html @@ -65,7 +65,7 @@

Name

ranch:resume_listener - Resume a suspended listener

Description

-
@@ -89,7 +89,7 @@ http://www.gnu.org/software/src-highlite -->

Examples

Resume a listener
-
diff --git a/docs/en/ranch/1.7/manual/ranch.set_max_connections/index.html b/docs/en/ranch/1.7/manual/ranch.set_max_connections/index.html index c25d3210..ab1c1caf 100644 --- a/docs/en/ranch/1.7/manual/ranch.set_max_connections/index.html +++ b/docs/en/ranch/1.7/manual/ranch.set_max_connections/index.html @@ -65,7 +65,7 @@

Name

ranch:set_max_connections - Set the max number of connections

Description

-
@@ -87,7 +87,7 @@ http://www.gnu.org/software/src-highlite -->

The atom ok is always returned. It can be safely ignored.

Examples

Set the max number of connections
-
diff --git a/docs/en/ranch/1.7/manual/ranch.set_protocol_options/index.html b/docs/en/ranch/1.7/manual/ranch.set_protocol_options/index.html index bfef32a3..e69e4e98 100644 --- a/docs/en/ranch/1.7/manual/ranch.set_protocol_options/index.html +++ b/docs/en/ranch/1.7/manual/ranch.set_protocol_options/index.html @@ -65,7 +65,7 @@

Name

ranch:set_protocol_options - Set the protocol options

Description

-
@@ -87,7 +87,7 @@ http://www.gnu.org/software/src-highlite -->

The atom ok is always returned. It can be safely ignored.

Examples

Set the protocol options
-
diff --git a/docs/en/ranch/1.7/manual/ranch.set_transport_options/index.html b/docs/en/ranch/1.7/manual/ranch.set_transport_options/index.html index 893b526f..f4b517a9 100644 --- a/docs/en/ranch/1.7/manual/ranch.set_transport_options/index.html +++ b/docs/en/ranch/1.7/manual/ranch.set_transport_options/index.html @@ -65,7 +65,7 @@

Name

ranch:set_transport_options - Set the transport options

Description

-
@@ -88,7 +88,7 @@ http://www.gnu.org/software/src-highlite -->

The atom ok is always returned. It can be safely ignored.

Examples

Set the transport options
-
diff --git a/docs/en/ranch/1.7/manual/ranch.start_listener/index.html b/docs/en/ranch/1.7/manual/ranch.start_listener/index.html index b5a5af72..cc06379d 100644 --- a/docs/en/ranch/1.7/manual/ranch.start_listener/index.html +++ b/docs/en/ranch/1.7/manual/ranch.start_listener/index.html @@ -65,7 +65,7 @@

Name

ranch:start_listener - Start a listener

Description

-
@@ -111,7 +111,7 @@ http://www.gnu.org/software/src-highlite -->

Examples

Start a listener
-
@@ -121,7 +121,7 @@ http://www.gnu.org/software/src-highlite --> ).
Start a listener with Ranch-specific options
-
@@ -134,7 +134,7 @@ http://www.gnu.org/software/src-highlite --> ).
Start a listener on a random port
-
diff --git a/docs/en/ranch/1.7/manual/ranch.stop_listener/index.html b/docs/en/ranch/1.7/manual/ranch.stop_listener/index.html index 4df7bd03..d1086774 100644 --- a/docs/en/ranch/1.7/manual/ranch.stop_listener/index.html +++ b/docs/en/ranch/1.7/manual/ranch.stop_listener/index.html @@ -65,7 +65,7 @@

Name

ranch:stop_listener - Stop a listener

Description

-
@@ -86,7 +86,7 @@ http://www.gnu.org/software/src-highlite -->

An error tuple is returned when the listener is not found.

Examples

Stop a listener
-
diff --git a/docs/en/ranch/1.7/manual/ranch.suspend_listener/index.html b/docs/en/ranch/1.7/manual/ranch.suspend_listener/index.html index 283e0645..7bf6deea 100644 --- a/docs/en/ranch/1.7/manual/ranch.suspend_listener/index.html +++ b/docs/en/ranch/1.7/manual/ranch.suspend_listener/index.html @@ -65,7 +65,7 @@

Name

ranch:suspend_listener - Suspend a running listener

Description

-
@@ -90,7 +90,7 @@ http://www.gnu.org/software/src-highlite -->

Examples

Suspend a listener
-
diff --git a/docs/en/ranch/1.7/manual/ranch.wait_for_connections/index.html b/docs/en/ranch/1.7/manual/ranch.wait_for_connections/index.html index 4ca0c580..ad0e9719 100644 --- a/docs/en/ranch/1.7/manual/ranch.wait_for_connections/index.html +++ b/docs/en/ranch/1.7/manual/ranch.wait_for_connections/index.html @@ -65,7 +65,7 @@

Name

ranch:wait_for_connections - Wait for a specific number of connections

Description

-
@@ -99,14 +99,14 @@ http://www.gnu.org/software/src-highlite -->

Examples

Wait for at least 100 connections
-
ranch:wait_for_connections(example, '>=', 100).
Gracefully shutdown a listener
-
diff --git a/docs/en/ranch/1.7/manual/ranch/index.html b/docs/en/ranch/1.7/manual/ranch/index.html index 0d572d49..160ccbcf 100644 --- a/docs/en/ranch/1.7/manual/ranch/index.html +++ b/docs/en/ranch/1.7/manual/ranch/index.html @@ -121,7 +121,7 @@

Types

max_conns()

-
@@ -130,7 +130,7 @@ http://www.gnu.org/software/src-highlite -->

Maximum number of connections allowed on this listener.

This is a soft limit. The actual number of connections might be slightly above the limit due to concurrency when accepting new connections. Some connections may also be removed from this count explicitly by the user code.

opt()

-
@@ -144,7 +144,7 @@ http://www.gnu.org/software/src-highlite -->

Deprecated form for Ranch-specific options.

Please use the opts() type when you need to provide Ranch-specific transport options. Socket options will remain separate from the Ranch-specific options.

opts()

-
@@ -188,7 +188,7 @@ http://www.gnu.org/software/src-highlite -->

ref()

-
diff --git a/docs/en/ranch/1.7/manual/ranch_app/index.html b/docs/en/ranch/1.7/manual/ranch_app/index.html index c9112ee6..8e59db21 100644 --- a/docs/en/ranch/1.7/manual/ranch_app/index.html +++ b/docs/en/ranch/1.7/manual/ranch_app/index.html @@ -91,7 +91,7 @@

All these applications must be started before the ranch application. To start Ranch and all dependencies at once:

-
diff --git a/docs/en/ranch/1.7/manual/ranch_protocol/index.html b/docs/en/ranch/1.7/manual/ranch_protocol/index.html index 491734f2..41d2faf9 100644 --- a/docs/en/ranch/1.7/manual/ranch_protocol/index.html +++ b/docs/en/ranch/1.7/manual/ranch_protocol/index.html @@ -68,7 +68,7 @@

The module ranch_protocol defines the interface used by Ranch protocols.

Callbacks

Ranch protocols implement the following interface:

-
diff --git a/docs/en/ranch/1.7/manual/ranch_proxy_header.header/index.html b/docs/en/ranch/1.7/manual/ranch_proxy_header.header/index.html index f11ccf2c..05689967 100644 --- a/docs/en/ranch/1.7/manual/ranch_proxy_header.header/index.html +++ b/docs/en/ranch/1.7/manual/ranch_proxy_header.header/index.html @@ -65,7 +65,7 @@

Name

ranch_proxy_header:header - Build a PROXY protocol header

Description

-
@@ -95,7 +95,7 @@ http://www.gnu.org/software/src-highlite -->

Examples

Build a PROXY protocol header
-
@@ -114,7 +114,7 @@ http://www.gnu.org/software/src-highlite --> Data = ranch_proxy_header:parse(ProxyInfo).
Build a PROXY protocol header with checksum and padding
-
diff --git a/docs/en/ranch/1.7/manual/ranch_proxy_header.parse/index.html b/docs/en/ranch/1.7/manual/ranch_proxy_header.parse/index.html index a71802d5..eea27d64 100644 --- a/docs/en/ranch/1.7/manual/ranch_proxy_header.parse/index.html +++ b/docs/en/ranch/1.7/manual/ranch_proxy_header.parse/index.html @@ -65,7 +65,7 @@

Name

ranch_proxy_header:parse - Parse a PROXY protocol header

Description

-
@@ -88,7 +88,7 @@ http://www.gnu.org/software/src-highlite -->

Examples

Parse the PROXY protocol header
-
diff --git a/docs/en/ranch/1.7/manual/ranch_proxy_header/index.html b/docs/en/ranch/1.7/manual/ranch_proxy_header/index.html index 38206908..c3be8e72 100644 --- a/docs/en/ranch/1.7/manual/ranch_proxy_header/index.html +++ b/docs/en/ranch/1.7/manual/ranch_proxy_header/index.html @@ -74,7 +74,7 @@

Types

proxy_info()

-
diff --git a/docs/en/ranch/1.7/manual/ranch_ssl/index.html b/docs/en/ranch/1.7/manual/ranch_ssl/index.html index e839491c..ca74fa16 100644 --- a/docs/en/ranch/1.7/manual/ranch_ssl/index.html +++ b/docs/en/ranch/1.7/manual/ranch_ssl/index.html @@ -70,7 +70,7 @@

The module ranch_ssl implements the interface defined by ranch_transport(3).

Types

opt()

-
@@ -79,7 +79,7 @@ http://www.gnu.org/software/src-highlite -->

Listen options.

The TCP options are defined in ranch_tcp(3).

opts()

-
@@ -87,7 +87,7 @@ http://www.gnu.org/software/src-highlite -->

List of listen options.

ssl_opt()

-
diff --git a/docs/en/ranch/1.7/manual/ranch_tcp/index.html b/docs/en/ranch/1.7/manual/ranch_tcp/index.html index 5b566045..a64b104a 100644 --- a/docs/en/ranch/1.7/manual/ranch_tcp/index.html +++ b/docs/en/ranch/1.7/manual/ranch_tcp/index.html @@ -71,7 +71,7 @@

The module ranch_tcp implements the interface defined by ranch_transport(3).

Types

opt()

-
@@ -180,7 +180,7 @@ http://www.gnu.org/software/src-highlite -->

In addition, the raw option can be used to set system-specific options by specifying the protocol level, the option number and the actual option value specified as a binary. This option is not portable. Use with caution.

opts()

-
diff --git a/docs/en/ranch/1.7/manual/ranch_transport.sendfile/index.html b/docs/en/ranch/1.7/manual/ranch_transport.sendfile/index.html index d781788d..3d121d38 100644 --- a/docs/en/ranch/1.7/manual/ranch_transport.sendfile/index.html +++ b/docs/en/ranch/1.7/manual/ranch_transport.sendfile/index.html @@ -65,7 +65,7 @@

Name

ranch_transport:sendfile - Send a file on the socket

Description

-
@@ -109,7 +109,7 @@ http://www.gnu.org/software/src-highlite -->

Examples

Implement Transport:sendfile using the fallback
-
diff --git a/docs/en/ranch/1.7/manual/ranch_transport/index.html b/docs/en/ranch/1.7/manual/ranch_transport/index.html index 4573297e..fa7d682d 100644 --- a/docs/en/ranch/1.7/manual/ranch_transport/index.html +++ b/docs/en/ranch/1.7/manual/ranch_transport/index.html @@ -69,7 +69,7 @@

Callbacks

Ranch transports implement the following interface:

accept

-
@@ -79,7 +79,7 @@ http://www.gnu.org/software/src-highlite -->

Use the listening socket returned by listen/1 to accept a new connection. The timeout is specified in milliseconds.

close

-
@@ -87,7 +87,7 @@ http://www.gnu.org/software/src-highlite -->

Close the socket.

controlling_process

-
@@ -96,7 +96,7 @@ http://www.gnu.org/software/src-highlite -->

Assign a new controlling process to the socket. The controlling process is the process that is linked to and receives messages from the socket.

getopts

-
@@ -105,7 +105,7 @@ http://www.gnu.org/software/src-highlite -->

Get one or more options for the socket.

getstat

-
@@ -113,7 +113,7 @@ http://www.gnu.org/software/src-highlite --> -> {ok, SockStatValues :: any()} | {error, atom()}

Get all statistics for the socket.

-
@@ -122,7 +122,7 @@ http://www.gnu.org/software/src-highlite -->

Get one or more statistic options for the socket.

handshake

-
@@ -135,7 +135,7 @@ http://www.gnu.org/software/src-highlite -->

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.

This function may also be used to upgrade a connection from a transport to another depending on the capabilities of the transports. For example a ranch_tcp socket may be upgraded to a ranch_ssl one using this function.

listen

-
@@ -145,7 +145,7 @@ http://www.gnu.org/software/src-highlite -->

Create a socket that listens on the given port.

The port may not be specified or may be set to 0, which means a random available port number will be chosen.

messages

-
@@ -156,7 +156,7 @@ http://www.gnu.org/software/src-highlite -->

Return the tuple keys for the messages sent by the socket.

name

-
@@ -164,7 +164,7 @@ http://www.gnu.org/software/src-highlite -->

Return the name of the transport.

peername

-
@@ -174,7 +174,7 @@ http://www.gnu.org/software/src-highlite -->

Return the address and port number for the other end of the connection.

recv

-
@@ -189,7 +189,7 @@ http://www.gnu.org/software/src-highlite -->

A length of 0 will return the data available on the socket as soon as possible, regardless of length.

While it is possible to use the timeout value infinity, it is highly discouraged as it could cause your process to get stuck waiting for data that will never come. This may happen when a socket becomes half-open due to a crash of the remote endpoint. Wi-Fi going down is another common culprit.

secure

-
@@ -197,7 +197,7 @@ http://www.gnu.org/software/src-highlite -->

Return whether the transport can be used for secure connections.

send

-
@@ -206,7 +206,7 @@ http://www.gnu.org/software/src-highlite -->

Send a packet on the socket.

sendfile

-
@@ -227,7 +227,7 @@ http://www.gnu.org/software/src-highlite -->

The file may be sent full or in parts, and may be specified by its filename or by an already open file descriptor.

Transports that manipulate TCP directly may use the file:sendfile/2,4,5 function, which calls the sendfile syscall where applicable (on Linux, for example). Other transports can use the sendfile/6 function exported from this module.

setopts

-
@@ -236,7 +236,7 @@ http://www.gnu.org/software/src-highlite -->

Set one or more options for the socket.

shutdown

-
@@ -246,7 +246,7 @@ http://www.gnu.org/software/src-highlite -->

Close the socket for reading and/or writing.

sockname

-
@@ -262,7 +262,7 @@ http://www.gnu.org/software/src-highlite -->

Types

sendfile_opts()

-
@@ -274,7 +274,7 @@ http://www.gnu.org/software/src-highlite -->

socket()

-
-- cgit v1.2.3