BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface software
Public Types | Public Member Functions | Public Attributes | List of all members
fc::detail::rate_limiting_group_impl Class Reference
Inheritance diagram for fc::detail::rate_limiting_group_impl:
fc::tcp_socket_io_hooks

Public Types

typedef std::list< rate_limited_operation * > rate_limited_operation_list
 

Public Member Functions

 rate_limiting_group_impl (uint32_t upload_bytes_per_second, uint32_t download_bytes_per_second, uint32_t burstiness_in_seconds=1)
 
 ~rate_limiting_group_impl ()
 
virtual size_t readsome (boost::asio::ip::tcp::socket &socket, char *buffer, size_t length) override
 
virtual size_t readsome (boost::asio::ip::tcp::socket &socket, const std::shared_ptr< char > &buffer, size_t length, size_t offset) override
 
template<typename BufferType >
size_t readsome_impl (boost::asio::ip::tcp::socket &socket, const BufferType &buffer, size_t length, size_t offset)
 
virtual size_t writesome (boost::asio::ip::tcp::socket &socket, const char *buffer, size_t length) override
 
virtual size_t writesome (boost::asio::ip::tcp::socket &socket, const std::shared_ptr< const char > &buffer, size_t length, size_t offset) override
 
template<typename BufferType >
size_t writesome_impl (boost::asio::ip::tcp::socket &socket, const BufferType &buffer, size_t length, size_t offset)
 
void process_pending_reads ()
 
void process_pending_writes ()
 
void process_pending_operations (time_point &last_iteration_start_time, uint32_t &limit_bytes_per_second, rate_limited_operation_list &operations_in_progress, rate_limited_operation_list &operations_for_next_iteration, uint32_t &tokens, uint32_t &unused_tokens)
 
- Public Member Functions inherited from fc::tcp_socket_io_hooks
virtual ~tcp_socket_io_hooks ()
 

Public Attributes

uint32_t _upload_bytes_per_second
 
uint32_t _download_bytes_per_second
 
uint32_t _burstiness_in_seconds
 
microseconds _granularity
 
uint32_t _read_tokens
 
uint32_t _unused_read_tokens
 
uint32_t _write_tokens
 
uint32_t _unused_write_tokens
 
rate_limited_operation_list _read_operations_in_progress
 
rate_limited_operation_list _read_operations_for_next_iteration
 
rate_limited_operation_list _write_operations_in_progress
 
rate_limited_operation_list _write_operations_for_next_iteration
 
time_point _last_read_iteration_time
 
time_point _last_write_iteration_time
 
future< void > _process_pending_reads_loop_complete
 
promise< void >::ptr _new_read_operation_available_promise
 
future< void > _process_pending_writes_loop_complete
 
promise< void >::ptr _new_write_operation_available_promise
 
average_rate_meter _actual_upload_rate
 
average_rate_meter _actual_download_rate
 

Detailed Description

Definition at line 187 of file rate_limiting.cpp.

Member Typedef Documentation

Definition at line 200 of file rate_limiting.cpp.

Constructor & Destructor Documentation

fc::detail::rate_limiting_group_impl::rate_limiting_group_impl ( uint32_t  upload_bytes_per_second,
uint32_t  download_bytes_per_second,
uint32_t  burstiness_in_seconds = 1 
)

Definition at line 240 of file rate_limiting.cpp.

fc::detail::rate_limiting_group_impl::~rate_limiting_group_impl ( )

Definition at line 253 of file rate_limiting.cpp.

Member Function Documentation

void fc::detail::rate_limiting_group_impl::process_pending_operations ( time_point last_iteration_start_time,
uint32_t &  limit_bytes_per_second,
rate_limited_operation_list operations_in_progress,
rate_limited_operation_list operations_for_next_iteration,
uint32_t &  tokens,
uint32_t &  unused_tokens 
)

Definition at line 405 of file rate_limiting.cpp.

void fc::detail::rate_limiting_group_impl::process_pending_reads ( )

Definition at line 363 of file rate_limiting.cpp.

void fc::detail::rate_limiting_group_impl::process_pending_writes ( )

Definition at line 384 of file rate_limiting.cpp.

size_t fc::detail::rate_limiting_group_impl::readsome ( boost::asio::ip::tcp::socket &  socket,
char *  buffer,
size_t  length 
)
overridevirtual

Implements fc::tcp_socket_io_hooks.

Definition at line 276 of file rate_limiting.cpp.

size_t fc::detail::rate_limiting_group_impl::readsome ( boost::asio::ip::tcp::socket &  socket,
const std::shared_ptr< char > &  buffer,
size_t  length,
size_t  offset 
)
overridevirtual

Implements fc::tcp_socket_io_hooks.

Definition at line 271 of file rate_limiting.cpp.

template<typename BufferType >
size_t fc::detail::rate_limiting_group_impl::readsome_impl ( boost::asio::ip::tcp::socket &  socket,
const BufferType &  buffer,
size_t  length,
size_t  offset 
)

Definition at line 282 of file rate_limiting.cpp.

size_t fc::detail::rate_limiting_group_impl::writesome ( boost::asio::ip::tcp::socket &  socket,
const char *  buffer,
size_t  length 
)
overridevirtual

Implements fc::tcp_socket_io_hooks.

Definition at line 317 of file rate_limiting.cpp.

size_t fc::detail::rate_limiting_group_impl::writesome ( boost::asio::ip::tcp::socket &  socket,
const std::shared_ptr< const char > &  buffer,
size_t  length,
size_t  offset 
)
overridevirtual

Implements fc::tcp_socket_io_hooks.

Definition at line 322 of file rate_limiting.cpp.

template<typename BufferType >
size_t fc::detail::rate_limiting_group_impl::writesome_impl ( boost::asio::ip::tcp::socket &  socket,
const BufferType &  buffer,
size_t  length,
size_t  offset 
)

Definition at line 328 of file rate_limiting.cpp.

Member Data Documentation

average_rate_meter fc::detail::rate_limiting_group_impl::_actual_download_rate

Definition at line 215 of file rate_limiting.cpp.

average_rate_meter fc::detail::rate_limiting_group_impl::_actual_upload_rate

Definition at line 214 of file rate_limiting.cpp.

uint32_t fc::detail::rate_limiting_group_impl::_burstiness_in_seconds

Definition at line 192 of file rate_limiting.cpp.

uint32_t fc::detail::rate_limiting_group_impl::_download_bytes_per_second

Definition at line 191 of file rate_limiting.cpp.

microseconds fc::detail::rate_limiting_group_impl::_granularity

Definition at line 194 of file rate_limiting.cpp.

time_point fc::detail::rate_limiting_group_impl::_last_read_iteration_time

Definition at line 206 of file rate_limiting.cpp.

time_point fc::detail::rate_limiting_group_impl::_last_write_iteration_time

Definition at line 207 of file rate_limiting.cpp.

promise<void>::ptr fc::detail::rate_limiting_group_impl::_new_read_operation_available_promise

Definition at line 210 of file rate_limiting.cpp.

promise<void>::ptr fc::detail::rate_limiting_group_impl::_new_write_operation_available_promise

Definition at line 212 of file rate_limiting.cpp.

future<void> fc::detail::rate_limiting_group_impl::_process_pending_reads_loop_complete

Definition at line 209 of file rate_limiting.cpp.

future<void> fc::detail::rate_limiting_group_impl::_process_pending_writes_loop_complete

Definition at line 211 of file rate_limiting.cpp.

rate_limited_operation_list fc::detail::rate_limiting_group_impl::_read_operations_for_next_iteration

Definition at line 202 of file rate_limiting.cpp.

rate_limited_operation_list fc::detail::rate_limiting_group_impl::_read_operations_in_progress

Definition at line 201 of file rate_limiting.cpp.

uint32_t fc::detail::rate_limiting_group_impl::_read_tokens

Definition at line 195 of file rate_limiting.cpp.

uint32_t fc::detail::rate_limiting_group_impl::_unused_read_tokens

Definition at line 196 of file rate_limiting.cpp.

uint32_t fc::detail::rate_limiting_group_impl::_unused_write_tokens

Definition at line 198 of file rate_limiting.cpp.

uint32_t fc::detail::rate_limiting_group_impl::_upload_bytes_per_second

Definition at line 190 of file rate_limiting.cpp.

rate_limited_operation_list fc::detail::rate_limiting_group_impl::_write_operations_for_next_iteration

Definition at line 204 of file rate_limiting.cpp.

rate_limited_operation_list fc::detail::rate_limiting_group_impl::_write_operations_in_progress

Definition at line 203 of file rate_limiting.cpp.

uint32_t fc::detail::rate_limiting_group_impl::_write_tokens

Definition at line 197 of file rate_limiting.cpp.


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