@@ -226,15 +226,16 @@ void CHEOS::handleConnect()
226
226
m_iMissedPongs = 0 ;
227
227
std::string sPort = std::to_string (m_Port);
228
228
boost::system::error_code ec;
229
- boost::asio::ip::tcp::resolver resolver (*m_Ios);
229
+ boost::asio::io_service io_service;
230
+ boost::asio::ip::tcp::resolver resolver (io_service);
230
231
boost::asio::ip::tcp::resolver::query query (m_IP, sPort );
231
232
boost::asio::ip::tcp::resolver::iterator iter = resolver.resolve (query);
232
233
boost::asio::ip::tcp::endpoint endpoint = *iter;
233
- m_Socket = new boost::asio::ip::tcp::socket (*m_Ios );
234
+ m_Socket = new boost::asio::ip::tcp::socket (io_service );
234
235
m_Socket->connect (endpoint, ec);
235
236
if (!ec)
236
237
{
237
- _log.Log (LOG_NORM, " HEOS by DENON: Connected to '%s:%s'." , m_IP.c_str (), sPort );
238
+ _log.Log (LOG_NORM, " HEOS by DENON: Connected to '%s:%s'." , m_IP.c_str (), sPort . c_str () );
238
239
m_Socket->async_read_some (boost::asio::buffer (m_Buffer, sizeof m_Buffer), boost::bind (&CHEOS::handleRead, this , boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
239
240
// Disable registration for change events following HEOS Controller advise
240
241
handleWrite (std::string (" heos://system/register_for_change_events?enable=off" ));
@@ -256,7 +257,12 @@ void CHEOS::handleConnect()
256
257
delete m_Socket;
257
258
m_Socket = NULL ;
258
259
}
260
+ }
261
+ else
262
+ {
263
+ _log.Log (LOG_NORM, " HEOS by DENON: Handle Connect, not connected" );
259
264
}
265
+
260
266
}
261
267
catch (std::exception& e)
262
268
{
@@ -657,6 +663,7 @@ bool CHEOS::StartHardware()
657
663
658
664
// Start worker thread
659
665
m_stoprequested = false ;
666
+ m_Socket = NULL ;
660
667
m_thread = boost::shared_ptr<boost::thread>(new boost::thread (boost::bind (&CHEOS::Do_Work, this )));
661
668
662
669
return (m_thread != NULL );
0 commit comments