bool Connect() { _dataStream.Connect(_hostname, _port); auto error = _dataStream.Client.error(); if (error) { TC_LOG_ERROR("metric", "Error connecting to '%s:%s', disabling Metric. Error message : %s", _hostname.c_str(), _port.c_str(), error.message().c_str()); _enabled = false; return false; } _dataStream.clear(); return true; }