summaryrefslogtreecommitdiffstats
path: root/src/server/net
diff options
context:
space:
mode:
authorManuel Schneider2014-07-22 14:35:30 +0200
committerManuel Schneider2014-07-22 14:35:30 +0200
commit4d522589c0ab04ae2be76d53788597626e57e71f (patch)
tree8f4352ca4d3ca259f4111a44955b8a0adc0c026a /src/server/net
parentNew bug detected (diff)
downloadpvs2-4d522589c0ab04ae2be76d53788597626e57e71f.tar.gz
pvs2-4d522589c0ab04ae2be76d53788597626e57e71f.tar.xz
pvs2-4d522589c0ab04ae2be76d53788597626e57e71f.zip
Bugfix: One click source change now fully supported
Since the async nature of this protocol introduces race conditions when changing the source of the projection, the possiblity that two servers exist at a moment is still there. Even though we thought we do not support multiple sources. This is the reason why _desiredProjectionSource is needed after all.
Diffstat (limited to 'src/server/net')
-rw-r--r--src/server/net/client.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/server/net/client.h b/src/server/net/client.h
index 61b6a5b..6dbb5bd 100644
--- a/src/server/net/client.h
+++ b/src/server/net/client.h
@@ -10,6 +10,8 @@
//class QSslSocket;
+#define NO_SOURCE 0
+
struct ClientLogin
{
bool accept;
@@ -33,15 +35,22 @@ public:
inline const QString& host() const { return _host; }
inline const QString ip() const { return _socket->peerAddress().toString(); }
inline const int id() const { return _id; }
+ inline const int desiredProjectionSource(){ return _desiredSource; }
inline const int projectionSource() const { return _projectionSource; }
inline const bool isActiveVncClient() const { return _isActiveVncClient; }
inline const bool isActiveVncServer() const { return _vncPort > 0; }
inline const bool isLocked() const { return _locked; }
- inline const bool isWatcher() const { return _isWatcher; }
+ inline const bool isWatcher() const { return _desiredSource != 0; }
+
+
// Setters
inline void setTutor(bool enable){ _isTutor = enable; }
inline void setWatcher(bool enable){ _isWatcher = enable; }
+ inline void setDesiredProjectionSource(int id){
+ qDebug() << "ID" <<_id << " new source " << _desiredSource;
+ _desiredSource = id;
+ }
//Send message stuff
void startVncServer();
@@ -65,7 +74,8 @@ private:
int _id; // this client's unique id
QString _vncRwPass, _vncRoPass;
int _vncPort; // VNCserver state. Greater 0 -> active on this port. Equals 0 -> no server.
- int _projectionSource; // VNCclient state. The source the client was or is connected to (depends on _isActiveVncClient)
+ int _desiredSource; // The source the client shall be connected to
+ int _projectionSource; // The source the client was or is connected to (depends on _isActiveVncClient)
bool _isActiveVncClient; // VNCclient state. indicating that the client is displaying a remote screen via VNC
bool _isTutor; // Flag indicating that the client has been set as a tutor
bool _isWatcher; // Flag indicates that the client should watch to VNC Server.