Browse Source

disabled work-timeout in stratumclient v2

cl-refactor
Genoil 9 years ago
parent
commit
cd89907aac
  1. 2
      libstratum/EthStratumClient.cpp
  2. 19
      libstratum/EthStratumClientV2.cpp
  3. BIN
      releases/ethminer-0.9.41-genoil-1.1.1.zip

2
libstratum/EthStratumClient.cpp

@ -1,4 +1,4 @@
#include "EthStratumClient.h"
#include <libdevcore/Log.h>
using boost::asio::ip::tcp;

19
libstratum/EthStratumClientV2.cpp

@ -51,8 +51,10 @@ void EthStratumClientV2::workLoop()
try {
if (!m_connected)
{
m_io_service.run();
//m_io_service.run();
//boost::thread t(boost::bind(&boost::asio::io_service::run, &m_io_service));
connect();
}
read_until(m_socket, m_responseBuffer, "\n");
std::istream is(&m_responseBuffer);
@ -126,8 +128,6 @@ void EthStratumClientV2::connect()
}
}
#define BOOST_ASIO_ENABLE_CANCELIO
void EthStratumClientV2::reconnect()
{
if (p_worktimer) {
@ -135,7 +135,7 @@ void EthStratumClientV2::reconnect()
p_worktimer = nullptr;
}
m_io_service.reset();
//m_io_service.reset();
//m_socket.close(); // leads to crashes on Linux
m_authorized = false;
m_connected = false;
@ -177,7 +177,7 @@ void EthStratumClientV2::disconnect()
p_farm->stop();
}
m_socket.close();
m_io_service.stop();
//m_io_service.stop();
}
void EthStratumClientV2::processReponse(Json::Value& responseObject)
@ -249,8 +249,8 @@ void EthStratumClientV2::processReponse(Json::Value& responseObject)
if (headerHash != m_current.headerHash)
{
//x_current.lock();
if (p_worktimer)
p_worktimer->cancel();
//if (p_worktimer)
// p_worktimer->cancel();
m_previous.headerHash = m_current.headerHash;
m_previous.seedHash = m_current.seedHash;
@ -264,9 +264,8 @@ void EthStratumClientV2::processReponse(Json::Value& responseObject)
p_farm->setWork(m_current);
//x_current.unlock();
p_worktimer = new boost::asio::deadline_timer(m_io_service, boost::posix_time::seconds(m_worktimeout));
p_worktimer->async_wait(boost::bind(&EthStratumClientV2::work_timeout_handler, this, boost::asio::placeholders::error));
//p_worktimer = new boost::asio::deadline_timer(m_io_service, boost::posix_time::seconds(m_worktimeout));
//p_worktimer->async_wait(boost::bind(&EthStratumClientV2::work_timeout_handler, this, boost::asio::placeholders::error));
}
}
}

BIN
releases/ethminer-0.9.41-genoil-1.1.1.zip

Binary file not shown.
Loading…
Cancel
Save