QtBase  v6.3.1
Classes | Public Types | Signals | Public Member Functions | Protected Member Functions | List of all members
PeerWireClient Class Reference

#include <peerwireclient.h>

Inheritance diagram for PeerWireClient:
Inheritance graph
[legend]
Collaboration diagram for PeerWireClient:
Collaboration graph
[legend]

Public Types

enum  PeerWireStateFlag { ChokingPeer = 0x1 , InterestedInPeer = 0x2 , ChokedByPeer = 0x4 , PeerIsInterested = 0x8 }
 
- Public Types inherited from QAbstractSocket
enum  SocketType { TcpSocket , UdpSocket , SctpSocket , UnknownSocketType = -1 }
 
enum  SocketError {
  ConnectionRefusedError , RemoteHostClosedError , HostNotFoundError , SocketAccessError ,
  SocketResourceError , SocketTimeoutError , DatagramTooLargeError , NetworkError ,
  AddressInUseError , SocketAddressNotAvailableError , UnsupportedSocketOperationError , UnfinishedSocketOperationError ,
  ProxyAuthenticationRequiredError , SslHandshakeFailedError , ProxyConnectionRefusedError , ProxyConnectionClosedError ,
  ProxyConnectionTimeoutError , ProxyNotFoundError , ProxyProtocolError , OperationError ,
  SslInternalError , SslInvalidUserDataError , TemporaryError , UnknownSocketError = -1
}
 
enum  SocketState {
  UnconnectedState , HostLookupState , ConnectingState , ConnectedState ,
  BoundState , ListeningState , ClosingState
}
 
enum  SocketOption {
  LowDelayOption , KeepAliveOption , MulticastTtlOption , MulticastLoopbackOption ,
  TypeOfServiceOption , SendBufferSizeSocketOption , ReceiveBufferSizeSocketOption , PathMtuSocketOption
}
 
enum  BindFlag { DefaultForPlatform = 0x0 , ShareAddress = 0x1 , DontShareAddress = 0x2 , ReuseAddressHint = 0x4 }
 
enum  PauseMode { PauseNever = 0x0 , PauseOnSslErrors = 0x1 }
 
using NetworkLayerProtocol = QHostAddress::NetworkLayerProtocol
 
- Public Types inherited from QIODeviceBase
enum  OpenModeFlag {
  NotOpen = 0x0000 , ReadOnly = 0x0001 , WriteOnly = 0x0002 , ReadWrite = ReadOnly | WriteOnly ,
  Append = 0x0004 , Truncate = 0x0008 , Text = 0x0010 , Unbuffered = 0x0020 ,
  NewOnly = 0x0040 , ExistingOnly = 0x0080
}
 

Signals

void infoHashReceived (const QByteArray &infoHash)
 
void readyToTransfer ()
 
void choked ()
 
void unchoked ()
 
void interested ()
 
void notInterested ()
 
void piecesAvailable (const QBitArray &pieces)
 
void blockRequested (int pieceIndex, int begin, int length)
 
void blockReceived (int pieceIndex, int begin, const QByteArray &data)
 
void bytesReceived (qint64 size)
 
- Signals inherited from QAbstractSocket
void hostFound ()
 
void connected ()
 
void disconnected ()
 
void stateChanged (QAbstractSocket::SocketState)
 
void errorOccurred (QAbstractSocket::SocketError)
 
void proxyAuthenticationRequired (const QNetworkProxy &proxy, QAuthenticator *authenticator)
 
- Signals inherited from QIODevice
void readyRead ()
 
void channelReadyRead (int channel)
 
void bytesWritten (qint64 bytes)
 
void channelBytesWritten (int channel, qint64 bytes)
 
void aboutToClose ()
 
void readChannelFinished ()
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 

Public Member Functions

 PeerWireClient (const QByteArray &peerId, QObject *parent=nullptr)
 
void initialize (const QByteArray &infoHash, int pieceCount)
 
void setPeer (TorrentPeer *peer)
 
TorrentPeerpeer () const
 
PeerWireState peerWireState () const
 
QBitArray availablePieces () const
 
QList< TorrentBlockincomingBlocks () const
 
void chokePeer ()
 
void unchokePeer ()
 
void sendInterested ()
 
void sendKeepAlive ()
 
void sendNotInterested ()
 
void sendPieceNotification (int piece)
 
void sendPieceList (const QBitArray &bitField)
 
void requestBlock (int piece, int offset, int length)
 
void cancelRequest (int piece, int offset, int length)
 
void sendBlock (int piece, int offset, const QByteArray &data)
 
qint64 writeToSocket (qint64 bytes)
 
qint64 readFromSocket (qint64 bytes)
 
qint64 downloadSpeed () const
 
qint64 uploadSpeed () const
 
bool canTransferMore () const
 
qint64 bytesAvailable () const override
 
qint64 socketBytesAvailable () const
 
qint64 socketBytesToWrite () const
 
void setReadBufferSize (qint64 size) override
 
void connectToHost (const QString &address, quint16 port, OpenMode openMode=ReadWrite, NetworkLayerProtocol protocol=AnyIPProtocol) override
 
void diconnectFromHost ()
 
- Public Member Functions inherited from QTcpSocket
 QTcpSocket (QObject *parent=nullptr)
 
virtual ~QTcpSocket ()
 
- Public Member Functions inherited from QAbstractSocket
 QAbstractSocket (SocketType socketType, QObject *parent)
 
virtual ~QAbstractSocket ()
 
virtual void resume ()
 
PauseModes pauseMode () const
 
void setPauseMode (PauseModes pauseMode)
 
virtual bool bind (const QHostAddress &address, quint16 port=0, BindMode mode=DefaultForPlatform)
 
bool bind (QHostAddress::SpecialAddress addr, quint16 port=0, BindMode mode=DefaultForPlatform)
 
bool bind (quint16 port=0, BindMode mode=DefaultForPlatform)
 
void connectToHost (const QHostAddress &address, quint16 port, OpenMode mode=ReadWrite)
 
virtual void disconnectFromHost ()
 
bool isValid () const
 
qint64 bytesAvailable () const override
 
qint64 bytesToWrite () const override
 
quint16 localPort () const
 
QHostAddress localAddress () const
 
quint16 peerPort () const
 
QHostAddress peerAddress () const
 
QString peerName () const
 
qint64 readBufferSize () const
 
void abort ()
 
virtual qintptr socketDescriptor () const
 
virtual bool setSocketDescriptor (qintptr socketDescriptor, SocketState state=ConnectedState, OpenMode openMode=ReadWrite)
 
virtual void setSocketOption (QAbstractSocket::SocketOption option, const QVariant &value)
 
virtual QVariant socketOption (QAbstractSocket::SocketOption option)
 
SocketType socketType () const
 
SocketState state () const
 
SocketError error () const
 
void close () override
 
bool isSequential () const override
 
bool flush ()
 
virtual bool waitForConnected (int msecs=30000)
 
bool waitForReadyRead (int msecs=30000) override
 
bool waitForBytesWritten (int msecs=30000) override
 
virtual bool waitForDisconnected (int msecs=30000)
 
void setProxy (const QNetworkProxy &networkProxy)
 
QNetworkProxy proxy () const
 
QString protocolTag () const
 
void setProtocolTag (const QString &tag)
 
- Public Member Functions inherited from QIODevice
 QIODevice ()
 
 QIODevice (QObject *parent)
 
virtual ~QIODevice ()
 
QIODeviceBase::OpenMode openMode () const
 
void setTextModeEnabled (bool enabled)
 
bool isTextModeEnabled () const
 
bool isOpen () const
 
bool isReadable () const
 
bool isWritable () const
 
int readChannelCount () const
 
int writeChannelCount () const
 
int currentReadChannel () const
 
void setCurrentReadChannel (int channel)
 
int currentWriteChannel () const
 
void setCurrentWriteChannel (int channel)
 
virtual bool open (QIODeviceBase::OpenMode mode)
 
virtual qint64 pos () const
 
virtual qint64 size () const
 
virtual bool seek (qint64 pos)
 
virtual bool atEnd () const
 
virtual bool reset ()
 
qint64 read (char *data, qint64 maxlen)
 
QByteArray read (qint64 maxlen)
 
QByteArray readAll ()
 
qint64 readLine (char *data, qint64 maxlen)
 
QByteArray readLine (qint64 maxlen=0)
 
virtual bool canReadLine () const
 
void startTransaction ()
 
void commitTransaction ()
 
void rollbackTransaction ()
 
bool isTransactionStarted () const
 
qint64 write (const char *data, qint64 len)
 
qint64 write (const char *data)
 
qint64 write (const QByteArray &data)
 
qint64 peek (char *data, qint64 maxlen)
 
QByteArray peek (qint64 maxlen)
 
qint64 skip (qint64 maxSize)
 
void ungetChar (char c)
 
bool putChar (char c)
 
bool getChar (char *c)
 
QString errorString () const
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 
virtual ~QObject ()
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const
 
void setObjectName (const QString &name)
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const noexcept
 
bool blockSignals (bool b) noexcept
 
QThreadthread () const
 
void moveToThread (QThread *thread)
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 
template<typename T >
T findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
const QObjectListchildren () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 
void dumpObjectInfo () const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 
bool inherits (const char *classname) const
 

Protected Member Functions

void timerEvent (QTimerEvent *event) override
 
qint64 readData (char *data, qint64 maxlen) override
 
qint64 readLineData (char *data, qint64 maxlen) override
 
qint64 writeData (const char *data, qint64 len) override
 
- Protected Member Functions inherited from QTcpSocket
 QTcpSocket (QTcpSocketPrivate &dd, QObject *parent=nullptr)
 
 QTcpSocket (QAbstractSocket::SocketType socketType, QTcpSocketPrivate &dd, QObject *parent=nullptr)
 
- Protected Member Functions inherited from QAbstractSocket
qint64 readData (char *data, qint64 maxlen) override
 
qint64 readLineData (char *data, qint64 maxlen) override
 
qint64 skipData (qint64 maxSize) override
 
qint64 writeData (const char *data, qint64 len) override
 
void setSocketState (SocketState state)
 
void setSocketError (SocketError socketError)
 
void setLocalPort (quint16 port)
 
void setLocalAddress (const QHostAddress &address)
 
void setPeerPort (quint16 port)
 
void setPeerAddress (const QHostAddress &address)
 
void setPeerName (const QString &name)
 
 QAbstractSocket (SocketType socketType, QAbstractSocketPrivate &dd, QObject *parent=nullptr)
 
- Protected Member Functions inherited from QIODevice
 QIODevice (QIODevicePrivate &dd, QObject *parent=nullptr)
 
void setOpenMode (QIODeviceBase::OpenMode openMode)
 
void setErrorString (const QString &errorString)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 
- Protected Member Functions inherited from QIODeviceBase
 ~QIODeviceBase ()=default
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 
- Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 
- Static Public Attributes inherited from QAbstractSocket
static constexpr auto IPv4Protocol = QHostAddress::IPv4Protocol
 
static constexpr auto IPv6Protocol = QHostAddress::IPv6Protocol
 
static constexpr auto AnyIPProtocol = QHostAddress::AnyIPProtocol
 
static constexpr auto UnknownNetworkLayerProtocol = QHostAddress::UnknownNetworkLayerProtocol
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Properties inherited from QObject
QString objectName
 the name of this object More...
 

Detailed Description

Definition at line 82 of file peerwireclient.h.

Member Enumeration Documentation

◆ PeerWireStateFlag

Enumerator
ChokingPeer 
InterestedInPeer 
ChokedByPeer 
PeerIsInterested 

Definition at line 87 of file peerwireclient.h.

Constructor & Destructor Documentation

◆ PeerWireClient()

PeerWireClient::PeerWireClient ( const QByteArray peerId,
QObject parent = nullptr 
)
explicit

Definition at line 86 of file peerwireclient.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ availablePieces()

QBitArray PeerWireClient::availablePieces ( ) const

Definition at line 139 of file peerwireclient.cpp.

Here is the caller graph for this function:

◆ blockReceived

void PeerWireClient::blockReceived ( int  pieceIndex,
int  begin,
const QByteArray data 
)
signal

◆ blockRequested

void PeerWireClient::blockRequested ( int  pieceIndex,
int  begin,
int  length 
)
signal

◆ bytesAvailable()

qint64 PeerWireClient::bytesAvailable ( ) const
inlineoverridevirtual

Returns the number of bytes that are available for reading. This function is commonly used with sequential devices to determine the number of bytes to allocate in a buffer before reading.

Subclasses that reimplement this function must call the base implementation in order to include the size of the buffer of QIODevice. Example:

See also
bytesToWrite(), readyRead(), isSequential()

Reimplemented from QIODevice.

Definition at line 125 of file peerwireclient.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bytesReceived

void PeerWireClient::bytesReceived ( qint64  size)
signal
Here is the caller graph for this function:

◆ cancelRequest()

void PeerWireClient::cancelRequest ( int  piece,
int  offset,
int  length 
)

Definition at line 273 of file peerwireclient.cpp.

◆ canTransferMore()

bool PeerWireClient::canTransferMore ( ) const

Definition at line 394 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ choked

void PeerWireClient::choked ( )
signal

◆ chokePeer()

void PeerWireClient::chokePeer ( )

Definition at line 150 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ connectToHost()

void PeerWireClient::connectToHost ( const QString hostName,
quint16  port,
OpenMode  openMode = ReadWrite,
NetworkLayerProtocol  protocol = AnyIPProtocol 
)
overridevirtual

Attempts to make a connection to hostName on the given port. The protocol parameter can be used to specify which network protocol to use (eg. IPv4 or IPv6).

The socket is opened in the given openMode and first enters HostLookupState, then performs a host name lookup of hostName. If the lookup succeeds, hostFound() is emitted and QAbstractSocket enters ConnectingState. It then attempts to connect to the address or addresses returned by the lookup. Finally, if a connection is established, QAbstractSocket enters ConnectedState and emits connected().

At any point, the socket can emit errorOccurred() to signal that an error occurred.

hostName may be an IP address in string form (e.g., "43.195.83.32"), or it may be a host name (e.g., "example.com"). QAbstractSocket will do a lookup only if required. port is in native byte order.

See also
state(), peerName(), peerAddress(), peerPort(), waitForConnected()

Reimplemented from QAbstractSocket.

Definition at line 400 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ diconnectFromHost()

void PeerWireClient::diconnectFromHost ( )

Definition at line 407 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ downloadSpeed()

qint64 PeerWireClient::downloadSpeed ( ) const

Definition at line 371 of file peerwireclient.cpp.

◆ incomingBlocks()

QList< TorrentBlock > PeerWireClient::incomingBlocks ( ) const

Definition at line 144 of file peerwireclient.cpp.

◆ infoHashReceived

void PeerWireClient::infoHashReceived ( const QByteArray infoHash)
signal
Here is the caller graph for this function:

◆ initialize()

void PeerWireClient::initialize ( const QByteArray infoHash,
int  pieceCount 
)

Definition at line 121 of file peerwireclient.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ interested

void PeerWireClient::interested ( )
signal

◆ notInterested

void PeerWireClient::notInterested ( )
signal

◆ peer()

TorrentPeer * PeerWireClient::peer ( ) const

Definition at line 134 of file peerwireclient.cpp.

Here is the caller graph for this function:

◆ peerWireState()

PeerWireState PeerWireClient::peerWireState ( ) const
inline

Definition at line 102 of file peerwireclient.h.

◆ piecesAvailable

void PeerWireClient::piecesAvailable ( const QBitArray pieces)
signal

◆ readData()

qint64 PeerWireClient::readData ( char *  data,
qint64  maxSize 
)
overrideprotectedvirtual

Reads up to maxSize bytes from the device into data, and returns the number of bytes read or -1 if an error occurred.

If there are no bytes to be read and there can never be more bytes available (examples include socket closed, pipe closed, sub-process finished), this function returns -1.

This function is called by QIODevice. Reimplement this function when creating a subclass of QIODevice.

When reimplementing this function it is important that this function reads all the required data before returning. This is required in order for QDataStream to be able to operate on the class. QDataStream assumes all the requested information was read and therefore does not retry reading if there was a problem.

This function might be called with a maxSize of 0, which can be used to perform post-reading operations.

See also
read(), readLine(), writeData()

Implements QIODevice.

Definition at line 654 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ readFromSocket()

qint64 PeerWireClient::readFromSocket ( qint64  bytes)

Definition at line 346 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ readLineData()

qint64 PeerWireClient::readLineData ( char *  data,
qint64  maxSize 
)
overrideprotectedvirtual

Reads up to maxSize characters into data and returns the number of characters read.

This function is called by readLine(), and provides its base implementation, using getChar(). Buffered devices can improve the performance of readLine() by reimplementing this function.

readLine() appends a '\0' byte to data; readLineData() does not need to do this.

If you reimplement this function, be careful to return the correct value: it should return the number of bytes read in this line, including the terminating newline, or 0 if there is no line to be read at this point. If an error occurs, it should return -1 if and only if no bytes were read. Reading past EOF is considered an error.

Reimplemented from QIODevice.

Definition at line 662 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ readyToTransfer

void PeerWireClient::readyToTransfer ( )
signal
Here is the caller graph for this function:

◆ requestBlock()

void PeerWireClient::requestBlock ( int  piece,
int  offset,
int  length 
)

Definition at line 250 of file peerwireclient.cpp.

◆ sendBlock()

void PeerWireClient::sendBlock ( int  piece,
int  offset,
const QByteArray data 
)

Definition at line 289 of file peerwireclient.cpp.

◆ sendInterested()

void PeerWireClient::sendInterested ( )

Definition at line 184 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ sendKeepAlive()

void PeerWireClient::sendKeepAlive ( )

Definition at line 176 of file peerwireclient.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendNotInterested()

void PeerWireClient::sendNotInterested ( )

Definition at line 200 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ sendPieceList()

void PeerWireClient::sendPieceList ( const QBitArray bitField)

Definition at line 220 of file peerwireclient.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendPieceNotification()

void PeerWireClient::sendPieceNotification ( int  piece)

Definition at line 209 of file peerwireclient.cpp.

◆ setPeer()

void PeerWireClient::setPeer ( TorrentPeer peer)

Definition at line 129 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ setReadBufferSize()

void PeerWireClient::setReadBufferSize ( qint64  size)
overridevirtual

Sets the size of QAbstractSocket's internal read buffer to be size bytes.

If the buffer size is limited to a certain size, QAbstractSocket won't buffer more than this size of data. Exceptionally, a buffer size of 0 means that the read buffer is unlimited and all incoming data is buffered. This is the default.

This option is useful if you only read the data at certain points in time (e.g., in a real-time streaming application) or if you want to protect your socket against receiving too much data, which may eventually cause your application to run out of memory.

Only QTcpSocket uses QAbstractSocket's internal buffer; QUdpSocket does not use any buffering at all, but rather relies on the implicit buffering provided by the operating system. Because of this, calling this function on QUdpSocket has no effect.

See also
readBufferSize(), read()

Reimplemented from QAbstractSocket.

Definition at line 389 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ socketBytesAvailable()

qint64 PeerWireClient::socketBytesAvailable ( ) const
inline

Definition at line 126 of file peerwireclient.h.

Here is the call graph for this function:

◆ socketBytesToWrite()

qint64 PeerWireClient::socketBytesToWrite ( ) const
inline

Definition at line 127 of file peerwireclient.h.

Here is the call graph for this function:

◆ timerEvent()

void PeerWireClient::timerEvent ( QTimerEvent event)
overrideprotectedvirtual

This event handler can be reimplemented in a subclass to receive timer events for the object.

QTimer provides a higher-level interface to the timer functionality, and also more general information about timers. The timer event is passed in the event parameter.

See also
startTimer(), killTimer(), event()

Reimplemented from QObject.

Definition at line 412 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ unchoked

void PeerWireClient::unchoked ( )
signal

◆ unchokePeer()

void PeerWireClient::unchokePeer ( )

Definition at line 164 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ uploadSpeed()

qint64 PeerWireClient::uploadSpeed ( ) const

Definition at line 381 of file peerwireclient.cpp.

◆ writeData()

qint64 PeerWireClient::writeData ( const char *  data,
qint64  maxSize 
)
overrideprotectedvirtual

Writes up to maxSize bytes from data to the device. Returns the number of bytes written, or -1 if an error occurred.

This function is called by QIODevice. Reimplement this function when creating a subclass of QIODevice.

When reimplementing this function it is important that this function writes all the data available before returning. This is required in order for QDataStream to be able to operate on the class. QDataStream assumes all the information was written and therefore does not retry writing if there was a problem.

See also
read(), write()

Implements QIODevice.

Definition at line 667 of file peerwireclient.cpp.

Here is the call graph for this function:

◆ writeToSocket()

qint64 PeerWireClient::writeToSocket ( qint64  bytes)

Definition at line 323 of file peerwireclient.cpp.

Here is the call graph for this function:

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