File tree Expand file tree Collapse file tree
src/mtconnect/source/adapter/shdr Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22set (AGENT_VERSION_MAJOR 2)
33set (AGENT_VERSION_MINOR 7)
44set (AGENT_VERSION_PATCH 0)
5- set (AGENT_VERSION_BUILD 4 )
5+ set (AGENT_VERSION_BUILD 5 )
66set (AGENT_VERSION_RC "" )
77
88# This minimum version is to support Visual Studio 2019 and C++ feature checking and FetchContent
Original file line number Diff line number Diff line change @@ -136,6 +136,8 @@ namespace mtconnect::source::adapter::shdr {
136136 return true ;
137137 }
138138
139+ // / @brief Attempt to reconnect after a delay. If the server is a hostname, re-resolve it to get the current IP
140+ // / address in case it has changed. If the server is a static IP address, just reconnect.
139141 inline void Connector::asyncTryConnect ()
140142 {
141143 NAMED_SCOPE (" Connector::asyncTryConnect" );
@@ -148,9 +150,9 @@ namespace mtconnect::source::adapter::shdr {
148150 // Re-resolve hostname to handle DHCP/dynamic IP environments.
149151 // If the server is a hostname (not a static IP), re-resolve to get
150152 // the current IP address in case it has changed.
151- boost::system::error_code parseEc ;
152- asio:: ip::address::from_string (m_server, parseEc );
153- if (parseEc )
153+ boost::system::error_code addrEc ;
154+ ip::make_address (m_server, addrEc );
155+ if (addrEc )
154156 {
155157 // m_server is a hostname, re-resolve it
156158 asio::dispatch (m_strand, boost::bind (&Connector::resolve, this ));
You can’t perform that action at this time.
0 commit comments