@@ -46,6 +46,7 @@ class http_listener_config
4646 // / </summary>
4747 http_listener_config ()
4848 : m_timeout(utility::seconds(120 ))
49+ , m_backlog(0 )
4950 {}
5051
5152 // / <summary>
@@ -54,6 +55,7 @@ class http_listener_config
5455 // / <param name="other">http_listener_config to copy.</param>
5556 http_listener_config (const http_listener_config &other)
5657 : m_timeout(other.m_timeout)
58+ , m_backlog(other.m_backlog)
5759#if !defined(_WIN32) || defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
5860 , m_ssl_context_callback(other.m_ssl_context_callback)
5961#endif
@@ -65,6 +67,7 @@ class http_listener_config
6567 // / <param name="other">http_listener_config to move from.</param>
6668 http_listener_config (http_listener_config &&other)
6769 : m_timeout(std::move(other.m_timeout))
70+ , m_backlog(std::move(other.m_backlog))
6871#if !defined(_WIN32) || defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
6972 , m_ssl_context_callback(std::move(other.m_ssl_context_callback))
7073#endif
@@ -79,6 +82,7 @@ class http_listener_config
7982 if (this != &rhs)
8083 {
8184 m_timeout = rhs.m_timeout ;
85+ m_backlog = rhs.m_backlog ;
8286#if !defined(_WIN32) || defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
8387 m_ssl_context_callback = rhs.m_ssl_context_callback ;
8488#endif
@@ -95,6 +99,7 @@ class http_listener_config
9599 if (this != &rhs)
96100 {
97101 m_timeout = std::move (rhs.m_timeout );
102+ m_backlog = std::move (rhs.m_backlog );
98103#if !defined(_WIN32) || defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
99104 m_ssl_context_callback = std::move (rhs.m_ssl_context_callback );
100105#endif
@@ -120,6 +125,26 @@ class http_listener_config
120125 m_timeout = std::move (timeout);
121126 }
122127
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+
123148#if !defined(_WIN32) || defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
124149 // / <summary>
125150 // / Get the callback of ssl context
@@ -143,6 +168,7 @@ class http_listener_config
143168private:
144169
145170 utility::seconds m_timeout;
171+ int m_backlog;
146172#if !defined(_WIN32) || defined(CPPREST_FORCE_HTTP_LISTENER_ASIO)
147173 std::function<void (boost::asio::ssl::context&)> m_ssl_context_callback;
148174#endif
0 commit comments