@@ -46,6 +46,7 @@ class http_listener_config
46
46
// / </summary>
47
47
http_listener_config ()
48
48
: m_timeout(utility::seconds(120 ))
49
+ , m_backlog(0 )
49
50
{}
50
51
51
52
// / <summary>
@@ -54,6 +55,7 @@ class http_listener_config
54
55
// / <param name="other">http_listener_config to copy.</param>
55
56
http_listener_config (const http_listener_config &other)
56
57
: m_timeout(other.m_timeout)
58
+ , m_backlog(other.m_backlog)
57
59
#if !defined(_WIN32) || defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
58
60
, m_ssl_context_callback(other.m_ssl_context_callback)
59
61
#endif
@@ -65,6 +67,7 @@ class http_listener_config
65
67
// / <param name="other">http_listener_config to move from.</param>
66
68
http_listener_config (http_listener_config &&other)
67
69
: m_timeout(std::move(other.m_timeout))
70
+ , m_backlog(std::move(other.m_backlog))
68
71
#if !defined(_WIN32) || defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
69
72
, m_ssl_context_callback(std::move(other.m_ssl_context_callback))
70
73
#endif
@@ -79,6 +82,7 @@ class http_listener_config
79
82
if (this != &rhs)
80
83
{
81
84
m_timeout = rhs.m_timeout ;
85
+ m_backlog = rhs.m_backlog ;
82
86
#if !defined(_WIN32) || defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
83
87
m_ssl_context_callback = rhs.m_ssl_context_callback ;
84
88
#endif
@@ -95,6 +99,7 @@ class http_listener_config
95
99
if (this != &rhs)
96
100
{
97
101
m_timeout = std::move (rhs.m_timeout );
102
+ m_backlog = std::move (rhs.m_backlog );
98
103
#if !defined(_WIN32) || defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
99
104
m_ssl_context_callback = std::move (rhs.m_ssl_context_callback );
100
105
#endif
@@ -120,6 +125,26 @@ class http_listener_config
120
125
m_timeout = std::move (timeout);
121
126
}
122
127
128
+ // / <summary>
129
+ // / Get the listen backlog
130
+ // / </summary>
131
+ // / <returns>The maximum length of the queue of pending connections, or zero for the implementation default.</returns>
132
+ // / <remarks>The implementation may not honour this value.</remarks>
133
+ int backlog () const
134
+ {
135
+ return m_backlog;
136
+ }
137
+
138
+ // / <summary>
139
+ // / Set the listen backlog
140
+ // / </summary>
141
+ // / <param name="backlog">The maximum length of the queue of pending connections, or zero for the implementation default.</param>
142
+ // / <remarks>The implementation may not honour this value.</remarks>
143
+ void set_backlog (int backlog)
144
+ {
145
+ m_backlog = backlog;
146
+ }
147
+
123
148
#if !defined(_WIN32) || defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
124
149
// / <summary>
125
150
// / Get the callback of ssl context
@@ -143,6 +168,7 @@ class http_listener_config
143
168
private:
144
169
145
170
utility::seconds m_timeout;
171
+ int m_backlog;
146
172
#if !defined(_WIN32) || defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
147
173
std::function<void (boost::asio::ssl::context&)> m_ssl_context_callback;
148
174
#endif
0 commit comments