/// <summary> /// Client on connectin handler. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnClientConnection(object sender, ConnectionEventArgs e) { _logger.Debug("Stratum client connected: {0}", e.Connection.ToString()); // TODO: remove the jobManager dependency by instead injecting extranonce counter. var miner = _minerManager.Create<StratumMiner>(_jobManager.ExtraNonce.Next(), e.Connection, _pool); e.Connection.Client = miner; }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnClientDisconnect(object sender, ConnectionEventArgs e) { _logger.Debug("Stratum client disconnected: {0}", e.Connection.ToString()); _minerManager.Remove(e.Connection); }
private void OnClientDisconnect(ConnectionEventArgs e) { var handler = ClientDisconnected; if (handler != null) handler(this, e); }