void Connection::start() { profile.lastTime = QDateTime::currentDateTime(); //perform a latency test if the latency is unknown if (profile.latency == SQProfile::LATENCY_UNKNOWN) { latencyTest(); } QSS::Profile qssprofile = profile.toProfile(); if (controller) { controller->deleteLater(); } controller = new QSS::Controller(true, false, this); connect(controller, &QSS::Controller::runningStateChanged, [&](bool run){ running = run; emit stateChanged(run); }); connect(controller, &QSS::Controller::tcpLatencyAvailable, this, &Connection::onLatencyAvailable); connect(controller, &QSS::Controller::newBytesReceived, this, &Connection::onNewBytesTransmitted); connect(controller, &QSS::Controller::newBytesSent, this, &Connection::onNewBytesTransmitted); connect(controller, &QSS::Controller::info, this, &Connection::onNewLog); if (profile.debug) { connect(controller, &QSS::Controller::debug, this, &Connection::onNewLog); } controller->setup(qssprofile); if (!controller->start()) { emit startFailed(); } }
void Connection::start() { profile.lastTime = QDateTime::currentDateTime(); latencyTest();//perform a latency test automatically when start() is called QSS::Profile qssprofile; qssprofile.server = profile.serverAddress; qssprofile.server_port = profile.serverPort; qssprofile.local_address = profile.localAddress; qssprofile.local_port = profile.localPort; qssprofile.method = profile.method; qssprofile.password = profile.password; qssprofile.timeout = profile.timeout; controllerThread->setup(profile.debug, qssprofile); controllerThread->start(); }
void Connection::start() { profile.lastTime = QDateTime::currentDateTime(); //perform a latency test if the latency is unknown if (profile.latency == -3) { latencyTest(); } QSS::Profile qssprofile; qssprofile.server = profile.serverAddress; qssprofile.server_port = profile.serverPort; qssprofile.local_address = profile.localAddress; qssprofile.local_port = profile.localPort; qssprofile.method = profile.method; qssprofile.password = profile.password; qssprofile.timeout = profile.timeout; qssprofile.http_proxy = profile.httpMode; qssprofile.debug = profile.debug; if (controller) { controller->deleteLater(); } controller = new QSS::Controller(true, false, this); connect(controller, &QSS::Controller::runningStateChanged, [&](bool run){ running = run; emit stateChanged(run); }); connect(controller, &QSS::Controller::newBytesReceived, this, &Connection::onNewBytesTransmitted); connect(controller, &QSS::Controller::newBytesSent, this, &Connection::onNewBytesTransmitted); connect(controller, &QSS::Controller::info, this, &Connection::onNewLog); if (profile.debug) { connect(controller, &QSS::Controller::debug, this, &Connection::onNewLog); } controller->setup(qssprofile); if (!controller->start()) { emit startFailed(); } }