File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -323,6 +323,16 @@ namespace crow
323
323
}
324
324
}
325
325
326
+ // / \brief Set status variable to note that the address that Crow will handle requests on is bound
327
+ void address_is_bound () {
328
+ is_bound_ = true ;
329
+ }
330
+
331
+ // / \brief Get whether address that Crow will handle requests on is bound
332
+ bool is_bound () const {
333
+ return is_bound_;
334
+ }
335
+
326
336
// / \brief Set the connection timeout in seconds (default is 5)
327
337
self_t & timeout (std::uint8_t timeout)
328
338
{
@@ -803,6 +813,7 @@ namespace crow
803
813
std::uint8_t timeout_{5 };
804
814
uint16_t port_ = 80 ;
805
815
unsigned int concurrency_ = 2 ;
816
+ std::atomic_bool is_bound_ = false ;
806
817
uint64_t max_payload_{UINT64_MAX};
807
818
std::string server_name_ = std::string(" Crow/" ) + VERSION;
808
819
std::string bindaddr_ = " 0.0.0.0" ;
Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ namespace crow // NOTE: Already documented in "crow/app.h"
200
200
});
201
201
}
202
202
handler_->port (acceptor_.port ());
203
+ handler_->address_is_bound ();
203
204
CROW_LOG_INFO << server_name_
204
205
<< " server is running at " << acceptor_.url_display (handler_->ssl_used ())
205
206
<< " using " << concurrency_ << " threads" ;
You can’t perform that action at this time.
0 commit comments