From 4ddd4e856a43c800227878c4b145aca15ce3f579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 14 Nov 2018 12:50:22 +0100 Subject: Ranch 1.7.0 --- index.xml | 558 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 557 insertions(+), 1 deletion(-) (limited to 'index.xml') diff --git a/index.xml b/index.xml index d830d354..fcb2571e 100644 --- a/index.xml +++ b/index.xml @@ -6,7 +6,7 @@ Recent content on Nine Nines Hugo -- gohugo.io en-us - Wed, 03 Oct 2018 07:00:00 +0100 + Wed, 14 Nov 2018 10:00:00 +0100 @@ -143,6 +143,18 @@ Prerequisites It is assumed the developer already knows Erlang and has some expe Supported platforms Ranch is tested and supported on Linux, FreeBSD, OSX and Windows. + + Introduction + https://ninenines.eu/docs/en/ranch/1.7/guide/introduction/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/guide/introduction/ + Ranch is a socket acceptor pool for TCP protocols. +Ranch aims to provide everything you need to accept TCP connections with a small code base and low latency while being easy to use directly as an application or to embed into your own. +Prerequisites It is assumed the developer already knows Erlang and has some experience with socket programming and TCP protocols. +Supported platforms Ranch is tested and supported on Linux, FreeBSD, OSX and Windows. + + The modern Web https://ninenines.eu/docs/en/cowboy/2.0/guide/modern_web/ @@ -330,6 +342,16 @@ The listener takes care of supervising all the acceptor and connection processes The listener takes care of supervising all the acceptor and connection processes, allowing developers to focus on building their application. + + Listeners + https://ninenines.eu/docs/en/ranch/1.7/guide/listeners/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/guide/listeners/ + A listener is a set of processes whose role is to listen on a port for new connections. It manages a pool of acceptor processes, each of them indefinitely accepting connections. When it does, it starts a new process executing the protocol handler code. All the socket programming is abstracted through the use of transport handlers. +The listener takes care of supervising all the acceptor and connection processes, allowing developers to focus on building their application. + + Starting and stopping https://ninenines.eu/docs/en/gun/1.0/guide/start/ @@ -566,6 +588,19 @@ SSL transport The SSL transport is a thin wrapper around ssl. Ranch depends on ssl by default so any necessary dependencies will start when Ranch is started. + + Transports + https://ninenines.eu/docs/en/ranch/1.7/guide/transports/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/guide/transports/ + A transport defines the interface to interact with a socket. +Transports can be used for connecting, listening and accepting connections, but also for receiving and sending data. Both passive and active mode are supported, although all sockets are initialized as passive. +TCP transport The TCP transport is a thin wrapper around gen_tcp. +SSL transport The SSL transport is a thin wrapper around ssl. +Ranch depends on ssl by default so any necessary dependencies will start when Ranch is started. + + Overview https://ninenines.eu/docs/en/erlang.mk/1/guide/overview/ @@ -671,6 +706,16 @@ Writing a protocol handler All protocol handlers must implement the ranch_protoc Writing a protocol handler 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. + + Protocols + https://ninenines.eu/docs/en/ranch/1.7/guide/protocols/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/guide/protocols/ + A protocol handler starts a connection process and defines the protocol logic executed in this process. +Writing a protocol handler 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. + + Getting started https://ninenines.eu/docs/en/cowboy/2.0/guide/getting_started/ @@ -840,6 +885,16 @@ Embedding To embed Ranch in your application you can simply add the child specs Embedding To embed Ranch in your application you can simply add the child specs to your supervision tree. This can all be done in the init/1 function of one of your application supervisors. + + Embedded mode + https://ninenines.eu/docs/en/ranch/1.7/guide/embedded/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/guide/embedded/ + Embedded mode allows you to insert Ranch listeners directly in your supervision tree. This allows for greater fault tolerance control by permitting the shutdown of a listener due to the failure of another part of the application and vice versa. +Embedding To embed Ranch in your application you can simply add the child specs to your supervision tree. This can all be done in the init/1 function of one of your application supervisors. + + Limitations https://ninenines.eu/docs/en/erlang.mk/1/guide/limitations/ @@ -1024,6 +1079,17 @@ Text protocols Schema-less binary protocols Schema-based binary protocols Th This chapter isn't specifically about Ranch, we assume here that you know how to read data from the socket. The data you read and the data that hasn't been parsed is saved in a buffer. + + Writing parsers + https://ninenines.eu/docs/en/ranch/1.7/guide/parsers/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/guide/parsers/ + There are three kinds of protocols: +Text protocols Schema-less binary protocols Schema-based binary protocols This chapter introduces the first two kinds. It will not cover more advanced topics such as continuations or parser generators. +This chapter isn't specifically about Ranch, we assume here that you know how to read data from the socket. The data you read and the data that hasn't been parsed is saved in a buffer. + + Building https://ninenines.eu/docs/en/erlang.mk/1/guide/app/ @@ -1182,6 +1248,16 @@ The server only needs to retain the certificate serial number and the certificat The server only needs to retain the certificate serial number and the certificate issuer to authenticate the certificate. Together, they can be used to uniquely identify a certicate. + + SSL client authentication + https://ninenines.eu/docs/en/ranch/1.7/guide/ssl_auth/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/guide/ssl_auth/ + Purpose SSL client authentication is a mechanism allowing applications to identify certificates. This allows your application to make sure that the client is an authorized certificate, but makes no claim about whether the user can be trusted. This can be combined with a password based authentication to attain greater security. +The server only needs to retain the certificate serial number and the certificate issuer to authenticate the certificate. Together, they can be used to uniquely identify a certicate. + + Packages and dependencies https://ninenines.eu/docs/en/erlang.mk/1/guide/deps/ @@ -1326,6 +1402,16 @@ Note that for everything related to efficiency and performance, you should perfo Note that for everything related to efficiency and performance, you should perform the benchmarks yourself to get the numbers that matter to you. Generic benchmarks found on the web may or may not be of use to you, you can never know until you benchmark your own system. + + Internals + https://ninenines.eu/docs/en/ranch/1.7/guide/internals/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/guide/internals/ + This chapter may not apply to embedded Ranch as embedding allows you to use an architecture specific to your application, which may or may not be compatible with the description of the Ranch application. +Note that for everything related to efficiency and performance, you should perform the benchmarks yourself to get the numbers that matter to you. Generic benchmarks found on the web may or may not be of use to you, you can never know until you benchmark your own system. + + Migrating from Gun 1.0 to 1.1 https://ninenines.eu/docs/en/gun/1.2/guide/migrating_from_1.0/ @@ -1439,6 +1525,16 @@ RELX_CONFIG = $(CURDIR)/webchat.config Relx does not need to be installed. Erla The function ranch:start_listener/6 has been deprecated in favor of ranch:start_listener/5. The number of acceptors was removed and will be taken from the transport options. The function ranch:child_spec/6 has also been deprecated, in favor of ranch:child_spec/5. The function ranch:accept_ack/1 has been deprecated in favor of ranch:handshake/1,2. The function ranch:info/1,2 will return a map containing each listener's information rather than a list of key/values. + + Upcoming changes in Ranch 2.0 + https://ninenines.eu/docs/en/ranch/1.7/guide/upcoming_2.0_changes/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/guide/upcoming_2.0_changes/ + The following changes will be done in Ranch 2.0. In most cases an alternative is already available in the most recent Ranch version. +The function ranch:start_listener/6 has been deprecated in favor of ranch:start_listener/5. The number of acceptors was removed and will be taken from the transport options. The function ranch:child_spec/6 has also been deprecated, in favor of ranch:child_spec/5. The function ranch:accept_ack/1 has been deprecated in favor of ranch:handshake/1,2. The function ranch:info/1,2 will return a map containing each listener's information rather than a list of key/values. + + Migrating from Gun 1.0 to 1.1 https://ninenines.eu/docs/en/gun/1.3/guide/migrating_from_1.0/ @@ -1562,6 +1658,17 @@ Ranch 1.6.2 This release fixes an issue where listener information would not get Ranch 1.6.1 This release fixes a minor issue in the README and adds an undocumented function to help Cowboy deal with the transition from list to map for the transport options. + + Migrating from Ranch 1.6 to 1.7 + https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.6/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.6/ + Ranch 1.7 adds built-in support for the PROXY protocol. +The PROXY protocol is a simple and efficient way for proxies to transmit information about the client. +While a third-party library already existed, it was not entirely compatible with the Ranch interface, in particular when socket active mode was involved. This new implementation fixes that and supports the full protocol with as little overhead as possible compared to normal operations: just one extra function call. + + Loop handlers https://ninenines.eu/docs/en/cowboy/2.0/guide/loop_handlers/ @@ -1719,6 +1826,17 @@ Ranch 1.6 is compatible with Erlang/OTP 18.0 onward. Support for older releases Features added Listeners can now be suspended/resumed without stopping existing connection processes. This effectively closes the listening socket and stops the acceptor processes. Transport options can now be updated for suspended listeners. + + Migrating from Ranch 1.5 to 1.6 + https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.5/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.5/ + Ranch 1.6 added the ability to suspend and resume listeners. It also deprecates a number of features and add interfaces that will be used in Ranch 2.0. +Ranch 1.6 is compatible with Erlang/OTP 18.0 onward. Support for older releases has been removed. +Features added Listeners can now be suspended/resumed without stopping existing connection processes. This effectively closes the listening socket and stops the acceptor processes. Transport options can now be updated for suspended listeners. + + AsciiDoc documentation https://ninenines.eu/docs/en/erlang.mk/1/guide/asciidoc/ @@ -1806,6 +1924,16 @@ The Req object is the subject of a few different chapters. In this chapter we wi 1.5.0 Add transport functions getopts/2, getstat/1 and getstat/2 Fix ranch:info/0 and ranch:procs/2 in embedded mode Prevent ranch_conns_sup from stopping on unexpected messages 1.4.0 Add new transport option num_acceptor Deprecate ranch:start_listener/6 in favor of start_listener/5 Deprecate ranch:child_spec/6 in favor of child_spec/5 1.3.0 The version numbers 1.3.1 and 1.3.2 were later made to fix small mistakes made during the 1. + + Migrating from Ranch 1.x + https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.x/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.x/ + The changelog for Ranch releases before 1.6 can be found in this section. +1.5.0 Add transport functions getopts/2, getstat/1 and getstat/2 Fix ranch:info/0 and ranch:procs/2 in embedded mode Prevent ranch_conns_sup from stopping on unexpected messages 1.4.0 Add new transport option num_acceptor Deprecate ranch:start_listener/6 in favor of start_listener/5 Deprecate ranch:child_spec/6 in favor of child_spec/5 1.3.0 The version numbers 1.3.1 and 1.3.2 were later made to fix small mistakes made during the 1. + + Reading the request body https://ninenines.eu/docs/en/cowboy/2.0/guide/req_body/ @@ -3055,6 +3183,18 @@ Compatibility Compatibility with Erlang/OTP R16, 17 and 18 has been dropped. Erl HTTP IANA Registries HTTP Method Registry HTTP Status Code Registry Message Headers HTTP Parameters HTTP Alt-Svc Parameter Registry HTTP Authentication Scheme Registry HTTP Cache Directive Registry HTTP Digest Algorithm Values HTTP Origin-Bound Authentication Device Identifier Types HTTP Upgrade Token Registry HTTP Warn Codes HTTP/2 Parameters WebSocket Protocol Registries Current CORS: Cross-Origin Resource Sharing CSP2: Content Security Policy Level 2 DNT: Tracking Preference Expression (DNT) eventsource: Server-Sent Events Form content types: Form content types Preload: Preload PROXY: The PROXY protocol REST: Fielding's Dissertation RFC 1945: HTTP/1. + + Ranch 1.7 + https://ninenines.eu/articles/ranch-1.7.0/ + Wed, 14 Nov 2018 10:00:00 +0100 + + https://ninenines.eu/articles/ranch-1.7.0/ + Ranch 1.7.0 has been released! +This release adds built-in support for the PROXY protocol. +The PROXY protocol is a simple and efficient way for proxies to transmit information about the client. +While a third-party library already existed, it was not entirely compatible with the Ranch interface, in particular when socket active mode was involved. This new implementation fixes that and supports the full protocol with as little overhead as possible compared to normal operations: just one extra function call. + + Cowboy 2.5 https://ninenines.eu/articles/cowboy-2.5.0/ @@ -3866,6 +4006,20 @@ ranch(3) - Socket acceptor pool Transports: ranch_ssl(3) - SSL transport ranch_tcp(3) - TLS transport Behaviors: + + Ranch Function Reference + https://ninenines.eu/docs/en/ranch/1.7/manual/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ + Name ranch - Socket acceptor pool for TCP protocols +Description Ranch is a socket acceptor pool for TCP protocols. +Ranch manages listeners which are a set of processes that accept and manage connections. The connection's transport and protocol modules are configured per listener. Listeners can be inspected and reconfigured without interruptions in service. +Modules Functions: +ranch(3) - Socket acceptor pool ranch_proxy_header(3) - PROXY protocol Transports: +ranch_ssl(3) - SSL transport ranch_tcp(3) - TCP transport Behaviors: + + Ranch User Guide https://ninenines.eu/docs/en/ranch/1.2/guide/ @@ -3911,6 +4065,15 @@ ranch_ssl(3) - SSL transport ranch_tcp(3) - TLS transport Behaviors:Interface Introduction Listeners Transports Protocols Embedded mode How to Writing parsers SSL client authentication Advanced Internals Additional information Upcoming changes in Ranch 2.0 Changes since Ranch 1.6 Migrating from Ranch 1.5 to 1.6 Migrating from Ranch 1.x + + Ranch User Guide + https://ninenines.eu/docs/en/ranch/1.7/guide/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/guide/ + Interface Introduction Listeners Transports Protocols Embedded mode How to Writing parsers SSL client authentication Advanced Internals Additional information Upcoming changes in Ranch 2.0 Migrating from Ranch 1.6 to 1.7 Migrating from Ranch 1.5 to 1.6 Migrating from Ranch 1.x + + cowboy(3) https://ninenines.eu/docs/en/cowboy/2.0/manual/cowboy/ @@ -10484,6 +10647,20 @@ ranch:suspend_listener(3) - Suspend a running listener ranch:resume_listener(3) ranch:accept_ack(3) - Deprecated in favor of ranch:handshake(3) ranch:handshake(3) - Perform the transport handshake ranch:remove_connection(3) - Remove connection from the count Options: + + ranch(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch/ + Name ranch - Socket acceptor pool +Description The module ranch provides functions for starting and manipulating Ranch listeners. +Exports Start/stop: +ranch:start_listener(3) - Start a listener ranch:stop_listener(3) - Stop a listener ranch:child_spec(3) - Build child specifications for a new listener Suspend/resume: +ranch:suspend_listener(3) - Suspend a running listener ranch:resume_listener(3) - Resume a suspended listener ranch:get_status(3) - Get a listener's running state Connections: +ranch:accept_ack(3) - Deprecated in favor of ranch:handshake(3) ranch:handshake(3) - Perform the transport handshake ranch:recv_proxy_header(3) - Receive the PROXY protocol header ranch:remove_connection(3) - Remove connection from the count Options: + + ranch(7) https://ninenines.eu/docs/en/ranch/1.2/manual/ranch_app/ @@ -10551,6 +10728,20 @@ ranch(3) - Socket acceptor pool Transports: ranch_ssl(3) - SSL transport ranch_tcp(3) - TLS transport Behaviors: + + ranch(7) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_app/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_app/ + Name ranch - Socket acceptor pool for TCP protocols +Description Ranch is a socket acceptor pool for TCP protocols. +Ranch manages listeners which are a set of processes that accept and manage connections. The connection's transport and protocol modules are configured per listener. Listeners can be inspected and reconfigured without interruptions in service. +Modules Functions: +ranch(3) - Socket acceptor pool ranch_proxy_header(3) - PROXY protocol Transports: +ranch_ssl(3) - SSL transport ranch_tcp(3) - TCP transport Behaviors: + + ranch:child_spec(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.child_spec/ @@ -10563,6 +10754,18 @@ This function can be used to embed a listener directly in an application&apo Arguments Ref The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the configuration. + + ranch:child_spec(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.child_spec/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.child_spec/ + Name ranch:child_spec - Build child specifications for a new listener +Description child_spec(Ref :: ranch_ref(), Transport :: module(), TransOpts :: ranch:opts(), Protocol :: module(), ProtoOpts :: any()) -> supervisor:child_spec() Build child specifications for a new listener. +This function can be used to embed a listener directly in an application's supervision tree. +Arguments Ref The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the configuration. + + ranch:get_addr(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_addr/ @@ -10577,6 +10780,20 @@ The IP address is the IP of the network interface the socket is bound to. Examples Get the listening port and IP {IP, Port} = ranch:get_addr(example). + + ranch:get_addr(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_addr/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_addr/ + Name ranch:get_addr - Get the listening port and IP +Description get_addr(Ref :: ranch:ref()) -> {IP :: inet:ip_address(), Port :: inet:port_number()} Get the listening port and IP. +Arguments Ref The listener name. + Return value The address of the listener is returned as a tuple. +The IP address is the IP of the network interface the socket is bound to. +Examples Get the listening port and IP {IP, Port} = ranch:get_addr(example). + + ranch:get_max_connections(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_max_connections/ @@ -10590,6 +10807,19 @@ Arguments Ref The listener name. Examples Get the max number of connections MaxConns = ranch:get_max_connections(example). See also ranch:get_protocol_options(3), ranch:get_transport_options(3), ranch:set_max_connections(3), ranch(3) + + ranch:get_max_connections(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_max_connections/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_max_connections/ + Name ranch:get_max_connections - Get the max number of connections +Description get_max_connections(Ref :: ranch:ref()) -> MaxConns :: ranch:max_conns() Get the max number of connections. +Arguments Ref The listener name. + Return value The maximum number of connections is returned. +Examples Get the max number of connections MaxConns = ranch:get_max_connections(example). See also ranch:get_protocol_options(3), ranch:get_transport_options(3), ranch:set_max_connections(3), ranch(3) + + ranch:get_port(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_port/ @@ -10604,6 +10834,20 @@ Arguments Ref The listener name. Examples Get the listening port Port = ranch:get_port(example). See also ranch:start_listener(3), ranch:get_addr(3), ranch:info(3), ranch(3) + + ranch:get_port(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_port/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_port/ + Name ranch:get_port - Get the listening port +Description get_port(Ref :: ranch:ref()) -> Port :: inet:port_number() Get the listening port. +This function is particularly useful to retrieve the listening port number when it was not provided in the options and was chosen randomly instead. +Arguments Ref The listener name. + Return value The listening port is returned. +Examples Get the listening port Port = ranch:get_port(example). See also ranch:start_listener(3), ranch:get_addr(3), ranch:info(3), ranch(3) + + ranch:get_protocol_options(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_protocol_options/ @@ -10617,6 +10861,19 @@ Arguments Ref The listener name. Examples Get the current protocol options ProtoOpts = ranch:get_protocol_options(example). See also ranch:get_max_connections(3), ranch:get_transport_options(3), ranch:set_protocol_options(3), ranch(3) + + ranch:get_protocol_options(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_protocol_options/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_protocol_options/ + Name ranch:get_protocol_options - Get the current protocol options +Description get_protocol_options(Ref :: ranch:ref()) -> ProtoOpts :: any() Get the current protocol options. +Arguments Ref The listener name. + Return value The current protocol options are returned. +Examples Get the current protocol options ProtoOpts = ranch:get_protocol_options(example). See also ranch:get_max_connections(3), ranch:get_transport_options(3), ranch:set_protocol_options(3), ranch(3) + + ranch:get_status(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_status/ @@ -10630,6 +10887,19 @@ Arguments Ref The listener name. Changelog 1.6: Function introduced. Examples Get a listener's running state ranch:get_status(example). See also ranch:start_listener(3), ranch:stop_listener(3), ranch:suspend_listener(3), ranch:resume_listener(3), ranch:set_transport_options(3), ranch:wait_for_connections(3), ranch(3) + + ranch:get_status(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_status/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_status/ + Name ranch:get_status - Get a listener's running state +Description get_status(Ref :: ranch_ref()) -> running | suspended Get a listener's running state. +Arguments Ref The listener name. + Return value An atom is returned indicating the running status of the listener. +Changelog 1.6: Function introduced. Examples Get a listener's running state ranch:get_status(example). See also ranch:start_listener(3), ranch:stop_listener(3), ranch:suspend_listener(3), ranch:resume_listener(3), ranch:set_transport_options(3), ranch:wait_for_connections(3), ranch(3) + + ranch:get_transport_options(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_transport_options/ @@ -10643,6 +10913,19 @@ Arguments Ref The listener name. Examples Get the current transport options TransOpts = ranch:get_transport_options(example). See also ranch:get_max_connections(3), ranch:get_protocol_options(3), ranch:set_transport_options(3), ranch(3) + + ranch:get_transport_options(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_transport_options/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_transport_options/ + Name ranch:get_transport_options - Get the current transport options +Description get_transport_options(Ref :: ranch:ref()) -> TransOpts :: any() Get the current transport options. +Arguments Ref The listener name. + Return value The current transport options are returned. +Examples Get the current transport options TransOpts = ranch:get_transport_options(example). See also ranch:get_max_connections(3), ranch:get_protocol_options(3), ranch:set_transport_options(3), ranch(3) + + ranch:handshake(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.handshake/ @@ -10654,6 +10937,17 @@ Description handshake(Ref) -> handshake(Ref, []) handshake(Ref, Opts) -&a This function must be called by the protocol process in order to retrieve the socket for the connection. Ranch performs the handshake necessary to give control of the socket to this process and also does the transport handshake, for example setting up the TLS connection. + + ranch:handshake(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.handshake/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.handshake/ + Name ranch:handshake - Perform the transport handshake +Description handshake(Ref) -> handshake(Ref, []) handshake(Ref, Opts) -> {ok, Socket} Ref :: ranch:ref() Opts :: any() Socket :: any() Perform the transport handshake. +This function must be called by the protocol process in order to retrieve the socket for the connection. Ranch performs the handshake necessary to give control of the socket to this process and also does the transport handshake, for example setting up the TLS connection. + + ranch:info(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.info/ @@ -10669,6 +10963,21 @@ pid Pid of the listener's top-level supervisor. ip Interface Ranch listens on. + + ranch:info(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.info/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.info/ + Name ranch:info - Overview of Ranch listeners +Description info() -> [{Ref, Info}] info(Ref) -> Info Info :: [{Key :: atom(), Value :: any()}] Overview of Ranch listeners. +Arguments Ref The listener name. + Return value Returns detailed information about one or all Ranch listeners. The following keys are returned: +pid Pid of the listener's top-level supervisor. + status Listener status, either running or suspended. + ip Interface Ranch listens on. + + ranch:procs(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.procs/ @@ -10683,6 +10992,34 @@ Arguments Ref The listener name. Examples Get the pids of the acceptor processes Pids = ranch:procs(acceptors). Get the pids of the connection processes Pids = ranch:procs(connections). + + ranch:procs(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.procs/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.procs/ + Name ranch:procs - Retrieve pids from a listener +Description procs(Ref :: ranch:ref(), Type :: acceptors | connections) -> Pids :: [pid()] Retrieve pids from a listener. +Arguments Ref The listener name. + Type The type of process that will be returned. + Return value 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 Pids = ranch:procs(connections). + + + + ranch:recv_proxy_header(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.recv_proxy_header/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.recv_proxy_header/ + Name ranch:recv_proxy_header - Receive the PROXY protocol header +Description recv_proxy_header(ranch:ref(), timeout()) -> {ok, ranch_proxy_header:proxy_info()} | {error, Reason :: atom()} | {error, protocol_error, HumanReadable :: atom()} Receive the PROXY protocol header. +This function must be called before ranch:handshake/1,2 on newly accepted connections to read and parse the PROXY protocol header, if any. +Arguments Ref The listener name. + Timeout Receive timeout in milliseconds. + Return value An ok tuple is returned containing PROXY header information on success. + + ranch:remove_connection(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.remove_connection/ @@ -10695,6 +11032,18 @@ This connection will no longer be included in the count when limiting the number This function may only be called from a connection process. + + ranch:remove_connection(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.remove_connection/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.remove_connection/ + Name ranch:remove_connection - Remove connection from the count +Description remove_connection(Ref :: ranch:ref()) -> ok Remove connection from the count. +This connection will no longer be included in the count when limiting the number of connections. This can be useful in a mixed environment where some connections are active and others are passive. Passive connections spend most of their time idling and are not consuming much resources. +This function may only be called from a connection process. + + ranch:resume_listener(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.resume_listener/ @@ -10709,6 +11058,20 @@ Arguments Ref The listener name. Return value The atom ok is returned on success. + + ranch:resume_listener(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.resume_listener/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.resume_listener/ + Name ranch:resume_listener - Resume a suspended listener +Description resume_listener(Ref :: ranch_ref()) -> ok | {error, any()} Resume a suspended listener. +Ranch will start listening for and accepting connections again. The function ranch:set_transport_options(3) can be used to change the transport options before resuming the listener. +Nothing is done when the listener is already running. +Arguments Ref The listener name. + Return value The atom ok is returned on success. + + ranch:set_max_connections(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.set_max_connections/ @@ -10721,6 +11084,18 @@ The change will be applied immediately. If the new value is smaller than the pre Arguments Ref The listener name. + + ranch:set_max_connections(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.set_max_connections/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.set_max_connections/ + Name ranch:set_max_connections - Set the max number of connections +Description set_max_connections(Ref :: ranch:ref(), MaxConns :: ranch:max_conns()) -> ok Set the max number of connections. +The change will be applied immediately. If the new value is smaller than the previous one, Ranch will wait for the extra connections to terminate and will not accept new connections until the number of connections goes below the limit. +Arguments Ref The listener name. + + ranch:set_protocol_options(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.set_protocol_options/ @@ -10736,6 +11111,21 @@ Arguments Ref The listener name. Examples Set the protocol options ranch:set_protocol_options(example, ProtoOpts). + + ranch:set_protocol_options(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.set_protocol_options/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.set_protocol_options/ + Name ranch:set_protocol_options - Set the protocol options +Description set_protocol_options(Ref :: ranch:ref(), ProtoOpts :: any()) -> ok Set the protocol options. +The change will be applied immediately for all new connections. Old connections will not receive the new options. +Arguments Ref The listener name. + ProtoOpts The new protocol options. + Return value The atom ok is always returned. It can be safely ignored. +Examples Set the protocol options ranch:set_protocol_options(example, ProtoOpts). + + ranch:set_transport_options(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.set_transport_options/ @@ -10751,6 +11141,21 @@ Arguments Ref The listener name. Return value The atom ok is always returned. + + ranch:set_transport_options(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.set_transport_options/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.set_transport_options/ + Name ranch:set_transport_options - Set the transport options +Description set_transport_options(Ref :: ranch:ref(), TransOpts :: any()) -> ok | {error, running} Set the transport options. +The listener must be suspended for this call to succeed. If the listener is running, {error, running} will be returned. +The change will take effect when the listener resumes. +Arguments Ref The listener name. + TransOpts The new transport options. + Return value The atom ok is always returned. + + ranch:start_listener(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.start_listener/ @@ -10763,6 +11168,18 @@ A listener is a set of processes that accepts and manages connections using the Arguments Ref The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the configuration. + + ranch:start_listener(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.start_listener/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.start_listener/ + Name ranch:start_listener - Start a listener +Description start_listener(Ref :: ranch_ref(), Transport :: module(), TransOpts :: ranch:opts(), Protocol :: module(), ProtoOpts :: any()) -> {ok, ListenerPid :: pid()} | {error, any()} Start a listener. +A listener is a set of processes that accepts and manages connections using the given transport and protocol modules. +Arguments Ref The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the configuration. + + ranch:stop_listener(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.stop_listener/ @@ -10775,6 +11192,18 @@ The listener is stopped gracefully, first by closing the listening port, then by In order for the connection processes to exit gracefully, they need to trap exit signals and stop before the configured shutdown timeout. + + ranch:stop_listener(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.stop_listener/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.stop_listener/ + Name ranch:stop_listener - Stop a listener +Description stop_listener(Ref :: ranch_ref()) -> ok | {error, not_found} Stop a listener. +The listener is stopped gracefully, first by closing the listening port, then by stopping the connection processes. These processes are stopped according to the shutdown transport option, which may be set to brutally kill all connection processes or give them some time to stop properly. +In order for the connection processes to exit gracefully, they need to trap exit signals and stop before the configured shutdown timeout. + + ranch:suspend_listener(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.suspend_listener/ @@ -10787,6 +11216,18 @@ Ranch will stop listening for and accepting connections and the listening socket Some transport options can only be changed when the listener is suspended. Please consult the ranch:set_transport_options(3) manual for more information. + + ranch:suspend_listener(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.suspend_listener/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.suspend_listener/ + Name ranch:suspend_listener - Suspend a running listener +Description suspend_listener(Ref :: ranch_ref()) -> ok | {error, any()} Suspend a running listener. +Ranch will stop listening for and accepting connections and the listening socket will be closed. Existing connections will continue undisturbed. The function ranch:wait_for_connections(3) can be used to wait for connections to be closed if necessary. +Some transport options can only be changed when the listener is suspended. Please consult the ranch:set_transport_options(3) manual for more information. + + ranch:wait_for_connections(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.wait_for_connections/ @@ -10799,6 +11240,18 @@ This function waits until the number of connections on the given listener become This function can be used to gracefully shutdown a listener by first suspending the listener and then waiting for connections to terminate before finally stopping the listener. + + ranch:wait_for_connections(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.wait_for_connections/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.wait_for_connections/ + Name ranch:wait_for_connections - Wait for a specific number of connections +Description wait_for_connections(Ref :: ranch:ref(), Operator, NumConns :: non_neg_integer()) -> ok Operator :: '>' | '>=' | '==' | '=<' | '<' Wait for a specific number of connections. +This function waits until the number of connections on the given listener becomes higher than, equal to or lower than the given number. It never returns otherwise. +This function can be used to gracefully shutdown a listener by first suspending the listener and then waiting for connections to terminate before finally stopping the listener. + + ranch_protocol(3) https://ninenines.eu/docs/en/ranch/1.2/manual/ranch_protocol/ @@ -10876,6 +11329,56 @@ start_link(Ref :: ranch:ref(), _, Transport :: module(), ProtoOpts :: any()) -&a The only purpose of this callback is to start a process that will handle the socket. It must spawn the process, link and then return the new pid. + + ranch_protocol(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_protocol/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_protocol/ + Name ranch_protocol - Protocol modules +Description The module ranch_protocol defines the interface used by Ranch protocols. +Callbacks Ranch protocols implement the following interface: +start_link(Ref :: ranch:ref(), _, Transport :: module(), ProtoOpts :: any()) -> {ok, ConnPid :: pid()} | {ok, SupPid :: pid(), ConnPid :: pid()} Start a new connection process. +The only purpose of this callback is to start a process that will handle the socket. It must spawn the process, link and then return the new pid. + + + + ranch_proxy_header(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_proxy_header/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_proxy_header/ + Name ranch_proxy_header - PROXY protocol +Description The module ranch_proxy_header provides functions for parsing and building the PROXY protocol header. +Exports ranch_proxy_header:parse(3) - Parse a PROXY protocol header ranch_proxy_header:header(3) - Build a PROXY protocol header Types proxy_info() proxy_info() = #{ %% Mandatory part. version := 1 | 2, command := local | proxy, transport_family => undefined | ipv4 | ipv6 | unix, transport_protocol => undefined | stream | dgram, %% Addresses. + + + + ranch_proxy_header:header(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_proxy_header.header/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_proxy_header.header/ + Name ranch_proxy_header:header - Build a PROXY protocol header +Description header(ProxyInfo) -> header(ProxyInfo, #{}) header(ProxyInfo, BuildOpts) -> iodata() ProxyInfo :: ranch_proxy_header:proxy_info() BuildOpts :: #{ checksum => crc32, padding => pos_integer() %% >= 3 } Build a PROXY protocol header. +Arguments ProxyInfo The proxy information to encode. + BuildOpts Options to control whether to add a checksum or padding should be included in the encoded PROXY protocol header. + Return value The PROXY protocol header is returned. + + + + ranch_proxy_header:parse(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_proxy_header.parse/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_proxy_header.parse/ + Name ranch_proxy_header:parse - Parse a PROXY protocol header +Description parse(Data :: binary()) -> {ok, ranch_proxy_header:proxy_info(), Rest :: binary()} | {error, HumanReadable :: atom()} Parse a PROXY protocol header. +Arguments Data The PROXY protocol header optionally followed by more data. + Return value An ok tuple is returned on success, containing the proxy information found in the header and the rest of the data if more was provided. +An error tuple is returned when a protocol error is detected. + + ranch_ssl(3) https://ninenines.eu/docs/en/ranch/1.2/manual/ranch_ssl/ @@ -10935,6 +11438,21 @@ opts() opts() :: [opt()] List of listen options. ssl_opt() ssl_opt() = {alpn_preferred_protocols, [binary()]} | {beast_mitigation, one_n_minus_one | zero_n | disabled} | {cacertfile, string()} | {cacerts, [public_key:der_encoded()]} | {cert, public_key:der_encoded()} | {certfile, string()} | {ciphers, [ssl:erl_cipher_suite()] | string()} | {client_renegotiation, boolean()} | {crl_cache, {module(), {internal | any(), list()}}} | {crl_check, boolean() | peer | best_effort} | {depth, 0. + + ranch_ssl(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_ssl/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_ssl/ + Name ranch_ssl - SSL transport +Description The module ranch_ssl implements an SSL Ranch transport. +Exports The module ranch_ssl implements the interface defined by ranch_transport(3). +Types opt() opt() :: ranch_tcp:opt() | ssl_opt() Listen options. +The TCP options are defined in ranch_tcp(3). +opts() opts() :: [opt()] List of listen options. +ssl_opt() ssl_opt() = {alpn_preferred_protocols, [binary()]} | {beast_mitigation, one_n_minus_one | zero_n | disabled} | {cacertfile, string()} | {cacerts, [public_key:der_encoded()]} | {cert, public_key:der_encoded()} | {certfile, string()} | {ciphers, [ssl:erl_cipher_suite()] | string()} | {client_renegotiation, boolean()} | {crl_cache, {module(), {internal | any(), list()}}} | {crl_check, boolean() | peer | best_effort} | {depth, 0. + + ranch_tcp(3) https://ninenines.eu/docs/en/ranch/1.2/manual/ranch_tcp/ @@ -10996,6 +11514,19 @@ Exports The module ranch_tcp implements the interface defined by ranch_transport Types opt() opt() = {backlog, non_neg_integer()} | {buffer, non_neg_integer()} | {delay_send, boolean()} | {dontroute, boolean()} | {exit_on_close, boolean()} | {fd, non_neg_integer()} | {high_msgq_watermark, non_neg_integer()} | {high_watermark, non_neg_integer()} | inet | inet6 | {ip, inet:ip_address()} | {ipv6_v6only, boolean()} | {keepalive, boolean()} | {linger, {boolean(), non_neg_integer()}} | {low_msgq_watermark, non_neg_integer()} | {low_watermark, non_neg_integer()} | {nodelay, boolean()} | {port, inet:port_number()} | {priority, integer()} | {raw, non_neg_integer(), non_neg_integer(), binary()} | {recbuf, non_neg_integer()} | {send_timeout, timeout()} | {send_timeout_close, boolean()} | {sndbuf, non_neg_integer()} | {tos, integer()} Listen options. + + ranch_tcp(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_tcp/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_tcp/ + Name ranch_tcp - TCP transport +Description The module ranch_tcp implements a TCP Ranch transport. +The function sendfile may not work correctly when used against files stored in a VirtualBox shared folder. +Exports The module ranch_tcp implements the interface defined by ranch_transport(3). +Types opt() opt() = {backlog, non_neg_integer()} | {buffer, non_neg_integer()} | {delay_send, boolean()} | {dontroute, boolean()} | {exit_on_close, boolean()} | {fd, non_neg_integer()} | {high_msgq_watermark, non_neg_integer()} | {high_watermark, non_neg_integer()} | inet | inet6 | {ip, inet:ip_address()} | {ipv6_v6only, boolean()} | {keepalive, boolean()} | {linger, {boolean(), non_neg_integer()}} | {low_msgq_watermark, non_neg_integer()} | {low_watermark, non_neg_integer()} | {nodelay, boolean()} | {port, inet:port_number()} | {priority, integer()} | {raw, non_neg_integer(), non_neg_integer(), binary()} | {recbuf, non_neg_integer()} | {send_timeout, timeout()} | {send_timeout_close, boolean()} | {sndbuf, non_neg_integer()} | {tos, integer()} Listen options. + + ranch_transport(3) https://ninenines.eu/docs/en/ranch/1.2/manual/ranch_transport/ @@ -11069,6 +11600,19 @@ accept accept(LSocket :: socket(), Timeout :: timeout()) -> {ok, Socket : close close(Socket :: socket()) -> ok Close the socket. + + ranch_transport(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_transport/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_transport/ + Name ranch_transport - Transport modules +Description The module ranch_transport defines the interface used by Ranch transports. +Callbacks Ranch transports implement the following interface: +accept accept(LSocket :: socket(), Timeout :: timeout()) -> {ok, Socket :: socket()} | {error, closed | timeout | atom()} Use the listening socket returned by listen/1 to accept a new connection. The timeout is specified in milliseconds. +close close(Socket :: socket()) -> ok Close the socket. + + ranch_transport:sendfile(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch_transport.sendfile/ @@ -11078,6 +11622,18 @@ close close(Socket :: socket()) -> ok Close the socket. Name ranch_transport:sendfile - Send a file on the socket Description sendfile(Transport :: module(), Socket :: ranch_transport:socket(), File :: file:name_all() | file:fd(), Offset :: non_neg_integer(), Bytes :: non_neg_integer(), Opts :: ranch_transport:sendfile_opts()) -> {ok, SentBytes :: non_neg_integer()} | {error, atom()} Send a file on the socket. The file may be sent full or in parts, and may be specified by its filename or by an already open file descriptor. +This function emulates the function file:sendfile/2,4,5 and may be used when transports are not manipulating TCP directly. + + + + ranch_transport:sendfile(3) + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_transport.sendfile/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_transport.sendfile/ + Name ranch_transport:sendfile - Send a file on the socket +Description sendfile(Transport :: module(), Socket :: ranch_transport:socket(), File :: file:name_all() | file:fd(), Offset :: non_neg_integer(), Bytes :: non_neg_integer(), Opts :: ranch_transport:sendfile_opts()) -> {ok, SentBytes :: non_neg_integer()} | {error, atom()} Send a file on the socket. +The file may be sent full or in parts, and may be specified by its filename or by an already open file descriptor. This function emulates the function file:sendfile/2,4,5 and may be used when transports are not manipulating TCP directly. -- cgit v1.2.3