diff options
author | Marc Worrell <[email protected]> | 2016-08-27 00:05:32 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2016-09-19 13:34:50 +0200 |
commit | 2d56329c7b75f282fb70204a32dbd761f738f5b4 (patch) | |
tree | 9e7200d26d80ccc241e9e63c4c3b40b46786d353 | |
parent | 82c1aa77e64c610f6b2ac0666ae5435f5f79fa40 (diff) | |
download | ranch-2d56329c7b75f282fb70204a32dbd761f738f5b4.tar.gz ranch-2d56329c7b75f282fb70204a32dbd761f738f5b4.tar.bz2 ranch-2d56329c7b75f282fb70204a32dbd761f738f5b4.zip |
Add ipv6_v6only listen option
-rw-r--r-- | doc/src/manual/ranch_tcp.asciidoc | 3 | ||||
-rw-r--r-- | src/ranch_tcp.erl | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/doc/src/manual/ranch_tcp.asciidoc b/doc/src/manual/ranch_tcp.asciidoc index 1fc268d..6eb7fa3 100644 --- a/doc/src/manual/ranch_tcp.asciidoc +++ b/doc/src/manual/ranch_tcp.asciidoc @@ -30,6 +30,7 @@ opt() = {backlog, 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()} @@ -88,6 +89,8 @@ inet6:: Set up the socket for IPv6. ip:: Interface to listen on. Listen on all interfaces by default. +ipv6_v6only (false):: + Listen on IPv4 and IPv6 (false) or only on IPv6 (true). Use with inet6. keepalive (false):: Enable sending of keep-alive messages. linger ({false, 0}):: diff --git a/src/ranch_tcp.erl b/src/ranch_tcp.erl index e8429a5..958b3f9 100644 --- a/src/ranch_tcp.erl +++ b/src/ranch_tcp.erl @@ -47,6 +47,7 @@ | inet | inet6 | {ip, inet:ip_address()} + | {ipv6_v6only, boolean()} | {keepalive, boolean()} | {linger, {boolean(), non_neg_integer()}} | {low_msgq_watermark, non_neg_integer()} @@ -91,7 +92,7 @@ listen(Opts) -> %% 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, + 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]. |