diff --git a/commonLibs/livoxProto1/device.cpp b/commonLibs/livoxProto1/device.cpp index 18f603b..f212d63 100644 --- a/commonLibs/livoxProto1/device.cpp +++ b/commonLibs/livoxProto1/device.cpp @@ -125,7 +125,6 @@ class Device::ConnectReq { private: Device& device; - std::unique_ptr retryTimer; public: ConnectReq(Device& dev, smo::Callback cb) @@ -179,63 +178,6 @@ public: context->device.heartbeatFd = fd; context->device.startHeartbeat(); context->callOriginalCb(true); - return; - } - - // Start retry timer - if (OptionParser::getOptions().verbose) - { - std::cout << __func__ << ": Starting retry delay (" - << context->device.retryDelayMs << "ms), then trying known " - << "device again" << "\n"; - } - - context->retryTimer = std::make_unique( - context->device.componentThread->getIoService()); - - context->retryTimer->expires_from_now( - boost::posix_time::milliseconds(context->device.retryDelayMs)); - - context->retryTimer->async_wait( - std::bind( - &ConnectReq::connectReq3, context.get(), context, - std::placeholders::_1)); - } - - void connectReq3( - std::shared_ptr context, - const boost::system::error_code& error - ) - { - if (error) - { - context->callOriginalCb(false); - return; - } - - if (OptionParser::getOptions().verbose) - { - std::cout << __func__ << ": Trying to connect to known device " - << "again" << "\n"; - } - - context->device.connectToKnownDeviceReq( - {context, std::bind(&ConnectReq::connectReq4, context.get(), context, - std::placeholders::_1, std::placeholders::_2, - std::placeholders::_3)}); - } - - void connectReq4( - std::shared_ptr context, - bool success, const std::string& ipAddr, int fd - ) - { - if (success) - { - context->device.discoveredDevice.ipAddr = ipAddr; - context->device.heartbeatFd = fd; - context->device.startHeartbeat(); - context->callOriginalCb(true); return; }