X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fremotepeer.h;h=e577a86c82e5a2682742aa301f79d090ecc98648;hp=6c3e35f415a820ad15058a26e83c0c26e38da393;hb=64cf9f9b8a737dad5f29447805d4004cfd03c454;hpb=02bebb4c8f1c45397c55f1660176bfa0c303e703 diff --git a/src/common/remotepeer.h b/src/common/remotepeer.h index 6c3e35f4..e577a86c 100644 --- a/src/common/remotepeer.h +++ b/src/common/remotepeer.h @@ -30,12 +30,18 @@ class QTcpSocket; class QTimer; +class AuthHandler; + class RemotePeer : public Peer { Q_OBJECT public: - RemotePeer(QTcpSocket *socket, QObject *parent = 0); + // import the virtuals from the baseclass + using Peer::handle; + using Peer::dispatch; + + RemotePeer(AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0); virtual ~RemotePeer() {}; void setSignalProxy(SignalProxy *proxy); @@ -53,24 +59,17 @@ public: QTcpSocket *socket() const; - // this is only used for the auth phase and should be replaced by something more generic - virtual void writeSocketData(const QVariant &item) = 0; - public slots: void close(const QString &reason = QString()); signals: - // this is only used for the auth phase and should be replaced by something more generic - void dataReceived(const QVariant &item); - void transferProgress(int current, int max); + void socketStateChanged(QAbstractSocket::SocketState socketState); + void socketError(QAbstractSocket::SocketError error, const QString &errorString); protected: SignalProxy *signalProxy() const; - using Peer::handle; - using Peer::dispatch; - // These protocol messages get handled internally and won't reach SignalProxy void handle(const Protocol::HeartBeat &heartBeat); void handle(const Protocol::HeartBeatReply &heartBeatReply); @@ -80,6 +79,7 @@ protected: private slots: void sendHeartBeat(); void changeHeartBeatInterval(int secs); + void onSocketError(QAbstractSocket::SocketError error); private: QTcpSocket *_socket;