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
49#pragma GCC diagnostic push
50#pragma GCC diagnostic ignored "-Wfloat-equal"
52#if __has_warning
("-Wweak-vtables")
53#pragma GCC diagnostic ignored "-Wweak-vtables"
55#if __has_warning
("-Wcovered-switch-default")
56#pragma GCC diagnostic ignored "-Wcovered-switch-default"
60#include "utils/CLI11.hpp"
62#pragma GCC diagnostic pop
65#include "core/system/netdb.h"
67#include <netinet/in.h>
68#include <netinet/tcp.h>
76namespace net::in6::stream::
config {
82 net::in6::config::ConfigAddress<net::config::ConfigAddressLocal>::setAiFlags(AI_PASSIVE);
87 "--reuse-address{true}",
90 "Reuse socket address",
93 CLI::IsMember({
"true",
"false"})
);
102 CLI::IsMember({
"true",
"false"})
);
108 "Turn of IPv6 dual stack mode",
111 CLI::IsMember({
"true",
"false",
"default"})
);
114 "--disable-nagle-algorithm{true}",
117 "Turn of Nagle algorithm",
120 CLI::IsMember({
"true",
"false",
"default"})
);
134 ->default_val(reuseAddress ?
"true" :
"false")
152 ->default_val(reusePort ?
"true" :
"false")
170 ->default_val(iPv6Only ?
"true" :
"false")
181 if (disableNagleAlgorithm) {
188 ->default_val(disableNagleAlgorithm ?
"true" :
"false")
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 & 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)