summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2016-02-08 15:07:07 +0100
committerSimon Rettberg2016-02-08 15:07:07 +0100
commit0c2b1dd8a5290f8b7b03a7fce77e9a57d709c7a7 (patch)
tree6512c86304307aa01e408f779080ead44c0b0f4f
parent[client] Retry VNC connection up to 5 times (diff)
downloadpvs2-0c2b1dd8a5290f8b7b03a7fce77e9a57d709c7a7.tar.gz
pvs2-0c2b1dd8a5290f8b7b03a7fce77e9a57d709c7a7.tar.xz
pvs2-0c2b1dd8a5290f8b7b03a7fce77e9a57d709c7a7.zip
[client] Increase vnc client connect timeout to account for large pools of clients
-rw-r--r--src/client/vnc/vncthread.cpp6
-rw-r--r--src/client/vnc/vncthread.h2
-rw-r--r--src/client/vnc/vncwindow.cpp6
3 files changed, 10 insertions, 4 deletions
diff --git a/src/client/vnc/vncthread.cpp b/src/client/vnc/vncthread.cpp
index c9327ad..dfa35af 100644
--- a/src/client/vnc/vncthread.cpp
+++ b/src/client/vnc/vncthread.cpp
@@ -176,10 +176,12 @@ void VncThread::run()
setsockopt(_client->sock, SOL_TCP, TCP_QUICKACK, &one, sizeof(one));
// Main VNC event loop
- emit projectionStarted();
+ if (_run) {
+ _connected = true;
+ emit projectionStarted();
+ }
while (_run)
{
- _connected = true;
const int i = WaitForMessage(_client, 100 * 1000); // wait 100ms for message. returns -1 on error/disconnect, 0 if nothing happened, 1 if new data arrived
if (i < 0)
break;
diff --git a/src/client/vnc/vncthread.h b/src/client/vnc/vncthread.h
index bb1405c..a5b52b1 100644
--- a/src/client/vnc/vncthread.h
+++ b/src/client/vnc/vncthread.h
@@ -57,7 +57,7 @@ private:
int _srcStepX, _srcStepY, _dstStepX, _dstStepY;
- bool _connected;
+ volatile bool _connected;
volatile bool _run;
void calcScaling();
diff --git a/src/client/vnc/vncwindow.cpp b/src/client/vnc/vncwindow.cpp
index ff7c5d4..53877e1 100644
--- a/src/client/vnc/vncwindow.cpp
+++ b/src/client/vnc/vncwindow.cpp
@@ -124,7 +124,7 @@ void VncWindow::open(const QString& host, int port, const QString& passwd, bool
this->show();
_vncWorker->setTargetSize(this->size());
- _tcpTimeoutTimer = startTimer(4000);
+ _tcpTimeoutTimer = startTimer(10000);
_vncWorker->start(QThread::LowPriority);
}
@@ -170,6 +170,10 @@ void VncWindow::onUpdateImage(const int x, const int y, const int w, const int h
*/
void VncWindow::onProjectionStarted()
{
+ if (_tcpTimeoutTimer != 0) {
+ killTimer(_tcpTimeoutTimer);
+ _tcpTimeoutTimer = 0;
+ }
emit running(true, _clientId);
_redrawTimer = startTimer(3000);
}