#define REMOTEPEER_H
#include <QDateTime>
-#include <QTcpSocket>
+#include "peer.h"
#include "protocol.h"
#include "signalproxy.h"
+class QTcpSocket;
class QTimer;
-class RemotePeer : public SignalProxy::AbstractPeer
+class RemotePeer : public Peer
{
Q_OBJECT
// this is only used for the auth phase and should be replaced by something more generic
void dataReceived(const QVariant &item);
- void disconnected();
- void error(QAbstractSocket::SocketError);
-
void transferProgress(int current, int max);
protected:
SignalProxy *signalProxy() const;
- template<class T>
- void handle(const T &protoMessage);
+ using Peer::handle;
+ using Peer::dispatch;
// These protocol messages get handled internally and won't reach SignalProxy
void handle(const Protocol::HeartBeat &heartBeat);
int _lag;
};
-// Template methods we need in the header
-template<class T> inline
-void RemotePeer::handle(const T &protoMessage)
-{
- if (!signalProxy()) {
- qWarning() << Q_FUNC_INFO << "Cannot handle messages without a SignalProxy!";
- return;
- }
-
- // _heartBeatCount = 0;
-
- signalProxy()->handle(this, protoMessage);
-}
-
-
#endif