Added RTSP client connection timeout of 5 secs. See issue #91

This commit is contained in:
Andrea Bondavalli 2022-08-20 11:12:05 +02:00
parent 3d7c8761ee
commit acb1e55d08
2 changed files with 6 additions and 1 deletions

View File

@ -35,7 +35,7 @@ namespace po = boost::program_options;
namespace postyle = boost::program_options::command_line_style;
namespace logging = boost::log;
static std::string version("bondagit-1.5.1");
static std::string version("bondagit-1.5.2");
static std::atomic<bool> terminate = false;
void termination_handler(int signum) {

View File

@ -133,6 +133,11 @@ std::pair<bool, RtspSource> RtspClient::process(RtspClient::Observer callback,
try {
BOOST_LOG_TRIVIAL(debug) << "rtsp_client:: connecting to "
<< "rtsp://" << address << ":" << port << path;
#if BOOST_VERSION < 106600
s.expires_from_now(boost::posix_time::seconds(1));
#else
s.expires_after(boost::asio::chrono::seconds(1));
#endif
s.connect(address, port.length() ? port : dft_port);
if (!s || s.error()) {
BOOST_LOG_TRIVIAL(warning)