Scheduler< Impl, ImplPtr >::DownloadReq Class Reference

#include <scheduler.h>

Inheritance diagram for Scheduler< Impl, ImplPtr >::DownloadReq:

Inheritance graph
[legend]
Collaboration diagram for Scheduler< Impl, ImplPtr >::DownloadReq:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename Impl, typename ImplPtr = Impl*>
class Scheduler< Impl, ImplPtr >::DownloadReq

Download request is an indication that we wish to receive data from a peer.

As a general rule, the Scheduler assumes that when this request is submitted, there actually is pending data in the underlying socket to be received.

When the main scheduler decides we are allowed to receive data, it will call doRecv() method, where we can perform actual I/O.

Definition at line 648 of file scheduler.h.


Public Member Functions

 DownloadReq (const SSocketWrapper &s)
 Construct.
 ~DownloadReq ()
 Destructor.
virtual uint32_t doRecv (uint32_t amount)
 This method is called from SchedBase (as virtual function), and indicates that we may start performing actual data receiving on this socket.
virtual void notify () const
 Notify client code.

Private Member Functions

 DownloadReq ()
 Forbidden.

Private Attributes

SSocketWrapper m_obj
 Underlying socket.

Constructor & Destructor Documentation

template<typename Impl, typename ImplPtr = Impl*>
Scheduler< Impl, ImplPtr >::DownloadReq::DownloadReq const SSocketWrapper s  )  [inline]
 

Construct.

Definition at line 651 of file scheduler.h.

References CHECK_FAIL, Scheduler< Impl, ImplPtr >::DownloadReq::m_obj, and Scheduler< Impl, ImplPtr >::s_downReqs.

template<typename Impl, typename ImplPtr = Impl*>
Scheduler< Impl, ImplPtr >::DownloadReq::~DownloadReq  )  [inline]
 

Destructor.

Definition at line 661 of file scheduler.h.

References Scheduler< Impl, ImplPtr >::SSocketWrapper::getSocket(), Scheduler< Impl, ImplPtr >::DownloadReq::m_obj, and Scheduler< Impl, ImplPtr >::s_downReqs.

Here is the call graph for this function:

template<typename Impl, typename ImplPtr = Impl*>
Scheduler< Impl, ImplPtr >::DownloadReq::DownloadReq  )  [private]
 

Forbidden.


Member Function Documentation

template<typename Impl, typename ImplPtr = Impl*>
virtual uint32_t Scheduler< Impl, ImplPtr >::DownloadReq::doRecv uint32_t  amount  )  [inline, virtual]
 

This method is called from SchedBase (as virtual function), and indicates that we may start performing actual data receiving on this socket.

The received data is appended to sockets incoming data buffer.

Parameters:
amount Amount of data we are allowed to receive
Returns:
Amount of data actually received
If the remote peer is marked as no_limit in SchedBase, we ignore the limit here, and recevive max 100k with each block.

Implements SchedBase::DownloadReqBase.

Definition at line 677 of file scheduler.h.

References Scheduler< Impl, ImplPtr >::SSocketWrapper::getSocket(), SchedBase::instance(), SchedBase::isLimited(), Scheduler< Impl, ImplPtr >::SSocketWrapper::m_inBuffer, and Scheduler< Impl, ImplPtr >::DownloadReq::m_obj.

Here is the call graph for this function:

template<typename Impl, typename ImplPtr = Impl*>
virtual void Scheduler< Impl, ImplPtr >::DownloadReq::notify  )  const [inline, virtual]
 

Notify client code.

Implements SchedBase::ReqBase.

Definition at line 701 of file scheduler.h.

References Scheduler< Impl, ImplPtr >::DownloadReq::m_obj, Scheduler< Impl, ImplPtr >::SSocketWrapper::notify(), and SOCK_READ.

Here is the call graph for this function:


Member Data Documentation

template<typename Impl, typename ImplPtr = Impl*>
SSocketWrapper Scheduler< Impl, ImplPtr >::DownloadReq::m_obj [private]
 

Underlying socket.

Definition at line 706 of file scheduler.h.

Referenced by Scheduler< Impl, ImplPtr >::DownloadReq::doRecv(), Scheduler< Impl, ImplPtr >::DownloadReq::DownloadReq(), Scheduler< Impl, ImplPtr >::DownloadReq::notify(), and Scheduler< Impl, ImplPtr >::DownloadReq::~DownloadReq().


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