diff options
Diffstat (limited to 'src/ranch_tcp.erl')
-rw-r--r-- | src/ranch_tcp.erl | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/ranch_tcp.erl b/src/ranch_tcp.erl index 958b3f9..c2ad148 100644 --- a/src/ranch_tcp.erl +++ b/src/ranch_tcp.erl @@ -19,7 +19,7 @@ -export([secure/0]). -export([messages/0]). -export([listen/1]). --export([listen_options/0]). +-export([disallowed_listen_options/0]). -export([accept/2]). -export([accept_ack/2]). -export([connect/3]). @@ -83,19 +83,13 @@ listen(Opts) -> %% We set the port to 0 because it is given in the Opts directly. %% The port in the options takes precedence over the one in the %% first argument. - gen_tcp:listen(0, ranch:filter_options(Opts5, listen_options(), + gen_tcp:listen(0, ranch:filter_options(Opts5, disallowed_listen_options(), [binary, {active, false}, {packet, raw}, {reuseaddr, true}])). -%% 'inet' and 'inet6' are also allowed but they are handled +%% 'binary' and 'list' are disallowed but they are handled %% specifically as they do not have 2-tuple equivalents. -%% -%% The 4-tuple 'raw' option is also handled specifically. -listen_options() -> - [backlog, buffer, delay_send, dontroute, exit_on_close, fd, - high_msgq_watermark, high_watermark, ip, ipv6_v6only, - keepalive, linger, low_msgq_watermark, - low_watermark, nodelay, port, priority, recbuf, - send_timeout, send_timeout_close, sndbuf, tos]. +disallowed_listen_options() -> + [active, header, mode, packet, packet_size, line_delimiter, reuseaddr]. -spec accept(inet:socket(), timeout()) -> {ok, inet:socket()} | {error, closed | timeout | atom()}. |