2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
42#include "net/in6/stream/config/ConfigSocketServer.h"
44#include "net/config/stream/ConfigSocketServer.hpp"
46#ifndef DOXYGEN_SHOULD_SKIP_THIS
48#include "core/system/netdb.h"
49#include "utils/PreserveErrno.h"
52#include <netinet/in.h>
53#include <netinet/tcp.h>
60namespace net::in6::stream::
config {
70 "--reuse-address{true}",
73 "Reuse socket address",
76 CLI::IsMember({
"true",
"false"})
);
85 CLI::IsMember({
"true",
"false"})
);
87 std::string ipv6Only =
XSTR(IN6_IPV6_ONLY);
88 if (ipv6Only ==
"default") {
89 std::ifstream in(
"/proc/sys/net/ipv6/bindv6only");
94 ipv6Only = s ==
"1" ?
"true" :
"false";
102 "Turn off IPv6 dual stack mode",
105 CLI::IsMember({
"true",
"false",
"default"})
);
106 if (std::string(
XSTR(IN6_IPV6_ONLY)) ==
"default") {
111 "--disable-nagle-algorithm{true}",
114 "Turn of Nagle algorithm",
117 CLI::IsMember({
"true",
"false",
"default"})
);
118 if (std::string(
XSTR(IN6_SERVER_DISABLE_NAGLE_ALGORITHM)) ==
"default") {
183 if (disableNagleAlgorithm) {
ConfigPhysicalSocket & addSocketOption(int optLevel, int optName, int optValue)
CLI::Option * addSocketOption(const std::string &name, int optLevel, int optName, const std::string &description, const std::string &typeName, const std::string &defaultValue, const CLI::Validator &validator)
ConfigSocketServer(net::config::ConfigInstance *instance)
ConfigAddress & setAiFlags(int aiFlags)
ConfigAddress & setPortRequired(bool required=true)
ConfigAddress & setAiSockType(int aiSocktype)
ConfigAddress & setAiProtocol(int aiProtocol)
~ConfigSocketServer() override
bool getReuseAddress() const
bool getDisableNagleAlgorithm() const
CLI::Option * reuseAddressOpt
CLI::Option * disableNagleAlgorithmOpt
CLI::Option * iPv6OnlyOpt
ConfigSocketServer & setDisableNagleAlgorithm(bool disableNagleAlgorithm=true)
ConfigSocketServer & setIPv6Only(bool iPv6Only=true)
ConfigSocketServer(net::config::ConfigInstance *instance)
bool getReusePort() const
CLI::Option * reusePortOpt
ConfigSocketServer & setReusePort(bool reusePort=true)
ConfigSocketServer & setReuseAddress(bool reuseAddress=true)
CLI::Option * setDefaultValue(CLI::Option *option, const ValueTypeT &value, bool clear=true) const