Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
RemotePeer Class Reference

#include </tmp/quassel/src/common/remotepeer.h>

Inheritance diagram for RemotePeer:
Collaboration diagram for RemotePeer:

Public Slots

void close (const QString &reason=QString())
virtual void dispatch (const Protocol::RegisterClient &)=0
virtual void dispatch (const Protocol::ClientDenied &)=0
virtual void dispatch (const Protocol::ClientRegistered &)=0
virtual void dispatch (const Protocol::SetupData &)=0
virtual void dispatch (const Protocol::SetupFailed &)=0
virtual void dispatch (const Protocol::SetupDone &)=0
virtual void dispatch (const Protocol::Login &)=0
virtual void dispatch (const Protocol::LoginFailed &)=0
virtual void dispatch (const Protocol::LoginSuccess &)=0
virtual void dispatch (const Protocol::SessionState &)=0
virtual void dispatch (const Protocol::SyncMessage &)=0
virtual void dispatch (const Protocol::RpcCall &)=0
virtual void dispatch (const Protocol::InitRequest &)=0
virtual void dispatch (const Protocol::InitData &)=0

Signals

void transferProgress (int current, int max)
void socketError (QAbstractSocket::SocketError error, const QString &errorString)
void statusMessage (const QString &msg)
void disconnected ()
void secureStateChanged (bool secure=true)
void lagUpdated (int msecs)

Public Member Functions

 RemotePeer (AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent=0)
void setSignalProxy (SignalProxy *proxy)
virtual QString protocolName () const =0
virtual QString description () const
virtual quint16 enabledFeatures () const
bool isOpen () const
bool isSecure () const
bool isLocal () const
int lag () const
bool compressionEnabled () const
void setCompressionEnabled (bool enabled)
QTcpSocket * socket () const
virtual Protocol::Type protocol () const =0
AuthHandlerauthHandler () const

Protected Slots

virtual void onSocketStateChanged (QAbstractSocket::SocketState state)
virtual void onSocketError (QAbstractSocket::SocketError error)

Protected Member Functions

SignalProxysignalProxy () const
void writeMessage (const QByteArray &msg)
virtual void processMessage (const QByteArray &msg)=0
void handle (const Protocol::HeartBeat &heartBeat)
void handle (const Protocol::HeartBeatReply &heartBeatReply)
virtual void dispatch (const Protocol::HeartBeat &msg)=0
virtual void dispatch (const Protocol::HeartBeatReply &msg)=0
template<typename T >
void handle (const T &protoMessage)

Private Slots

void onReadyRead ()
void onCompressionError (Compressor::Error error)
void sendHeartBeat ()
void changeHeartBeatInterval (int secs)

Private Member Functions

bool readMessage (QByteArray &msg)

Private Attributes

QTcpSocket * _socket
Compressor_compressor
SignalProxy_signalProxy
QTimer * _heartBeatTimer
int _heartBeatCount
int _lag
quint32 _msgSize

Detailed Description

Definition at line 35 of file remotepeer.h.

Constructor & Destructor Documentation

Member Function Documentation

void setSignalProxy ( SignalProxy proxy)
virtual
virtual QString protocolName ( ) const
pure virtual
QString description ( ) const
virtual
virtual quint16 enabledFeatures ( ) const
inlinevirtual

Reimplemented in DataStreamPeer.

Definition at line 50 of file remotepeer.h.

Referenced by CoreAuthHandler::onReadyRead().

bool isOpen ( ) const
virtual

Implements Peer.

Definition at line 174 of file remotepeer.cpp.

References socket().

Referenced by setSignalProxy().

bool isSecure ( ) const
virtual

Implements Peer.

Definition at line 149 of file remotepeer.cpp.

References isLocal(), and socket().

bool isLocal ( ) const
virtual

Implements Peer.

Definition at line 164 of file remotepeer.cpp.

References socket().

Referenced by CoreAuthHandler::handle(), and isSecure().

int lag ( ) const
virtual

Implements Peer.

Definition at line 137 of file remotepeer.cpp.

References _lag.

bool compressionEnabled ( ) const
void setCompressionEnabled ( bool  enabled)
void transferProgress ( int  current,
int  max 
)
signal

Referenced by readMessage().

void socketError ( QAbstractSocket::SocketError  error,
const QString &  errorString 
)
signal

Referenced by onSocketError().

void statusMessage ( const QString &  msg)
signal

Referenced by onSocketStateChanged().

SignalProxy * signalProxy ( ) const
protectedvirtual

Implements Peer.

Definition at line 95 of file remotepeer.cpp.

References _signalProxy.

Referenced by LegacyPeer::processMessage(), DataStreamPeer::processMessage(), sendHeartBeat(), and setSignalProxy().

void writeMessage ( const QByteArray &  msg)
protected

Definition at line 238 of file remotepeer.cpp.

References _compressor, Compressor::NoFlush, and Compressor::write().

virtual void processMessage ( const QByteArray &  msg)
protectedpure virtual

Referenced by onReadyRead().

void handle ( const Protocol::HeartBeatReply heartBeatReply)
protected

Definition at line 252 of file remotepeer.cpp.

References _heartBeatCount, Peer::lagUpdated(), and HeartBeatReply::timestamp.

virtual void dispatch ( const Protocol::HeartBeatReply msg)
protectedpure virtual

Implemented in DataStreamPeer, and LegacyPeer.

void onSocketStateChanged ( QAbstractSocket::SocketState  state)
protectedvirtualslot

Definition at line 66 of file remotepeer.cpp.

References statusMessage().

Referenced by RemotePeer().

void onSocketError ( QAbstractSocket::SocketError  error)
protectedvirtualslot

Definition at line 74 of file remotepeer.cpp.

References socket(), and socketError().

Referenced by RemotePeer().

void onReadyRead ( )
privateslot

Definition at line 192 of file remotepeer.cpp.

References processMessage(), and readMessage().

Referenced by RemotePeer().

void onCompressionError ( Compressor::Error  error)
privateslot

Definition at line 80 of file remotepeer.cpp.

References close().

Referenced by RemotePeer().

void sendHeartBeat ( )
privateslot
void changeHeartBeatInterval ( int  secs)
privateslot

Definition at line 126 of file remotepeer.cpp.

References _heartBeatTimer.

Referenced by setSignalProxy().

bool readMessage ( QByteArray &  msg)
private
virtual Protocol::Type protocol ( ) const
pure virtualinherited
AuthHandler * authHandler ( ) const
inherited

Definition at line 31 of file peer.cpp.

References Peer::_authHandler.

virtual void dispatch ( const Protocol::RegisterClient )
pure virtualslotinherited
virtual void dispatch ( const Protocol::ClientDenied )
pure virtualslotinherited

Implemented in InternalPeer, DataStreamPeer, and LegacyPeer.

virtual void dispatch ( const Protocol::ClientRegistered )
pure virtualslotinherited

Implemented in InternalPeer, DataStreamPeer, and LegacyPeer.

virtual void dispatch ( const Protocol::SetupData )
pure virtualslotinherited

Implemented in InternalPeer, DataStreamPeer, and LegacyPeer.

virtual void dispatch ( const Protocol::SetupFailed )
pure virtualslotinherited

Implemented in InternalPeer, DataStreamPeer, and LegacyPeer.

virtual void dispatch ( const Protocol::SetupDone )
pure virtualslotinherited

Implemented in InternalPeer, DataStreamPeer, and LegacyPeer.

virtual void dispatch ( const Protocol::Login )
pure virtualslotinherited

Implemented in InternalPeer, DataStreamPeer, and LegacyPeer.

virtual void dispatch ( const Protocol::LoginFailed )
pure virtualslotinherited

Implemented in InternalPeer, DataStreamPeer, and LegacyPeer.

virtual void dispatch ( const Protocol::LoginSuccess )
pure virtualslotinherited

Implemented in InternalPeer, DataStreamPeer, and LegacyPeer.

virtual void dispatch ( const Protocol::SessionState )
pure virtualslotinherited

Implemented in InternalPeer, DataStreamPeer, and LegacyPeer.

virtual void dispatch ( const Protocol::SyncMessage )
pure virtualslotinherited

Implemented in DataStreamPeer, InternalPeer, and LegacyPeer.

virtual void dispatch ( const Protocol::RpcCall )
pure virtualslotinherited

Implemented in DataStreamPeer, InternalPeer, and LegacyPeer.

virtual void dispatch ( const Protocol::InitRequest )
pure virtualslotinherited

Implemented in DataStreamPeer, InternalPeer, and LegacyPeer.

virtual void dispatch ( const Protocol::InitData )
pure virtualslotinherited

Implemented in DataStreamPeer, InternalPeer, and LegacyPeer.

void secureStateChanged ( bool  secure = true)
signalinherited

Referenced by RemotePeer().

void lagUpdated ( int  msecs)
signalinherited

Referenced by handle(), and sendHeartBeat().

void handle ( const T &  protoMessage)
inlineprotectedinherited

Definition at line 97 of file peer.h.

References Protocol::AuthHandler, and Protocol::SignalProxy.

Referenced by InternalPeer::customEvent(), and InternalPeer::dispatch().

Member Data Documentation

QTcpSocket* _socket
private

Definition at line 98 of file remotepeer.h.

Referenced by socket().

Compressor* _compressor
private

Definition at line 99 of file remotepeer.h.

Referenced by readMessage(), RemotePeer(), and writeMessage().

SignalProxy* _signalProxy
private

Definition at line 100 of file remotepeer.h.

Referenced by setSignalProxy(), and signalProxy().

QTimer* _heartBeatTimer
private

Definition at line 101 of file remotepeer.h.

Referenced by changeHeartBeatInterval(), RemotePeer(), sendHeartBeat(), and setSignalProxy().

int _heartBeatCount
private

Definition at line 102 of file remotepeer.h.

Referenced by handle(), and sendHeartBeat().

int _lag
private

Definition at line 103 of file remotepeer.h.

Referenced by lag(), and sendHeartBeat().

quint32 _msgSize
private

Definition at line 104 of file remotepeer.h.

Referenced by readMessage().


The documentation for this class was generated from the following files: