Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions include/crow/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,16 @@ namespace crow
}
}

/// \brief Set status variable to note that the address that Crow will handle requests on is bound
void address_is_bound() {
is_bound_ = true;
}

/// \brief Get whether address that Crow will handle requests on is bound
bool is_bound() const {
return is_bound_;
}

/// \brief Set the connection timeout in seconds (default is 5)
self_t& timeout(std::uint8_t timeout)
{
Expand Down Expand Up @@ -803,6 +813,7 @@ namespace crow
std::uint8_t timeout_{5};
uint16_t port_ = 80;
unsigned int concurrency_ = 2;
std::atomic_bool is_bound_ = false;
uint64_t max_payload_{UINT64_MAX};
std::string server_name_ = std::string("Crow/") + VERSION;
std::string bindaddr_ = "0.0.0.0";
Expand Down
1 change: 1 addition & 0 deletions include/crow/http_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ namespace crow // NOTE: Already documented in "crow/app.h"
});
}
handler_->port(acceptor_.port());
handler_->address_is_bound();
CROW_LOG_INFO << server_name_
<< " server is running at " << acceptor_.url_display(handler_->ssl_used())
<< " using " << concurrency_ << " threads";
Expand Down
Loading