Explorar el Código

switching ping to every 10 seconds

logicp hace 5 años
padre
commit
5352f03ed7
Se han modificado 2 ficheros con 2 adiciones y 2 borrados
  1. 1 1
      src/client.cpp
  2. 1 1
      src/mainwindow.cpp

+ 1 - 1
src/client.cpp

@@ -85,7 +85,6 @@ void Client::handleMessages() {
             QVector<QString> args = getArgs(data_string.c_str());
             emit Client::messageReceived(EVENT_UPDATE_TYPE, event, args); // Update UI (event)
             if (isUploadCompleteEvent(event.toUtf8().constData())) { // Upload complete
-              file_was_sent = true;
               if (!args.isEmpty()) {
                 sent_files.at(sent_files.size() - 1).timestamp =
                     std::stoi(args.at(0).toUtf8().constData());
@@ -331,6 +330,7 @@ void Client::sendPackets(uint8_t* data, int size) {
         if (is_last_packet) {
             // cleanup
             qDebug() << "Last packet of file sent";
+            file_was_sent = true;
         }
     }
 }

+ 1 - 1
src/mainwindow.cpp

@@ -183,7 +183,7 @@ void MainWindow::connectClient() {
 
   QTimer* timer = new QTimer(this);
   connect(timer, &QTimer::timeout, q_client, &Client::ping);
-  timer->start(30000);
+  timer->start(10000);
 }
 
 void MainWindow::handleKey() {