You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New feature to log that the port is already used instead of just timeouting.
Consider the following example:
#include "crow_all.h"
int main(int /*ac*/, char ** /*av*/) {
CROW_LOG_INFO << "Playing some music";
crow::SimpleApp app;
CROW_ROUTE(app, "/")
([]() { return "Hello World"; });
app.loglevel(crow::LogLevel::DEBUG);
app.bindaddr("0.0.0.0").port(8000).multithreaded().run_async();
CROW_LOG_INFO << "Before wait";
auto status = app.wait_for_server_start();
CROW_LOG_INFO << "After wait";
if (status == std::cv_status::timeout)
{
CROW_LOG_INFO << "Timeout";
}
}
Which logs this if the port is already used (or nothing without custom logs)
(2024-11-26 12:01:46) [INFO ] Playing some music
(2024-11-26 12:01:46) [INFO ] Before wait
(2024-11-26 12:01:49) [INFO ] After wait
(2024-11-26 12:01:49) [INFO ] Timeout
Vs the error you get with run()
(2024-11-26 12:01:11) [INFO ] Playing some music
terminate called after throwing an instance of 'std::system_error'
what(): bind: Address already in use
[1] 1518945 IOT instruction ./src/radiopi
The address is already validated with: #918 logging
The text was updated successfully, but these errors were encountered:
New feature to log that the port is already used instead of just timeouting.
Consider the following example:
Which logs this if the port is already used (or nothing without custom logs)
Vs the error you get with
run()
The address is already validated with: #918 logging
The text was updated successfully, but these errors were encountered: