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
323323 }
324324 }
325325
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+
326336 // / \brief Set the connection timeout in seconds (default is 5)
327337 self_t & timeout (std::uint8_t timeout)
328338 {
@@ -803,6 +813,7 @@ namespace crow
803813 std::uint8_t timeout_{5 };
804814 uint16_t port_ = 80 ;
805815 unsigned int concurrency_ = 2 ;
816+ std::atomic_bool is_bound_ = false ;
806817 uint64_t max_payload_{UINT64_MAX};
807818 std::string server_name_ = std::string(" Crow/" ) + VERSION;
808819 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"
200200 });
201201 }
202202 handler_->port (acceptor_.port ());
203+ handler_->address_is_bound ();
203204 CROW_LOG_INFO << server_name_
204205 << " server is running at " << acceptor_.url_display (handler_->ssl_used ())
205206 << " using " << concurrency_ << " threads" ;
You can’t perform that action at this time.
0 commit comments