[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdenetwork/krfb/krfb
From:       George Kiagiadakis <kiagiadakis.george () gmail ! com>
Date:       2010-11-10 19:47:37
Message-ID: 20101110194737.36487AC89E () svn ! kde ! org
[Download RAW message or body]

SVN commit 1195307 by gkiagia:

Cache the remote address string in the client.

This is because we need to use it as the client's name even after
the client has been disconnected and the socket is closed.

 M  +5 -1      rfbclient.cpp  


--- trunk/KDE/kdenetwork/krfb/krfb/rfbclient.cpp #1195306:1195307
@@ -37,11 +37,15 @@
     bool controlEnabled;
     rfbClientPtr client;
     QSocketNotifier *notifier;
+    QString remoteAddressString;
 };
 
 RfbClient::RfbClient(rfbClientPtr client, QObject* parent)
     : QObject(parent), d(new Private(client))
 {
+    d->remoteAddressString = peerAddress(d->client->sock) + ":" +
+                             QString::number(peerPort(d->client->sock));
+
     d->notifier = new QSocketNotifier(client->sock, QSocketNotifier::Read, this);
     d->notifier->setEnabled(false);
     connect(d->notifier, SIGNAL(activated(int)), this, SLOT(onSocketActivated()));
@@ -55,7 +59,7 @@
 
 QString RfbClient::name() const
 {
-    return peerAddress(d->client->sock) + ":" + QString::number(peerPort(d->client->sock));
+    return d->remoteAddressString;
 }
 
 //static
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic