 |
libfilezilla
|
Go to the documentation of this file. 1 #ifndef LIBFILEZILLA_RATE_LIMITED_LAYER_HEADER
2 #define LIBFILEZILLA_RATE_LIMITED_LAYER_HEADER
24 virtual int read(
void*
buffer,
unsigned int size,
int& error)
override;
25 virtual int write(
void const*
buffer,
unsigned int size,
int& error)
override;
28 return next_layer_.get_state();
31 virtual int connect(
native_string const& host,
unsigned int port, address_type family = address_type::unknown)
override {
32 return next_layer_.connect(host, port, family);
36 return next_layer_.shutdown();
42 virtual void wakeup(direction::type d)
override;
59 virtual int read(
void*
buffer,
unsigned int size,
int& error)
override;
60 virtual int write(
void const*
buffer,
unsigned int size,
int& error)
override;
63 return next_layer_.get_state();
66 virtual int connect(
native_string const& host,
unsigned int port, address_type family = address_type::unknown)
override {
67 return next_layer_.connect(host, port, family);
71 return next_layer_.shutdown();
78 friend class crll_bucket;
79 std::vector<std::unique_ptr<crll_bucket>> buckets_;
The buffer class is a simple buffer where data can be appended at the end and consumed at the front....
Definition: buffer.hpp:25
socket_state
State transitions are monotonically increasing.
Definition: socket.hpp:326
A compound rate-limited socket layer.
Definition: rate_limited_layer.hpp:50
A rate-limited socket layer.
Definition: rate_limited_layer.hpp:18
virtual int shutdown() override
Signals peers that we want to close the connections.
Definition: rate_limited_layer.hpp:35
Lean replacement for std::(recursive_)mutex.
Definition: mutex.hpp:27
Classes for rate-limiting.
A base class for socket layers.
Definition: socket.hpp:567
socket_event_flag
The type of a socket event.
Definition: socket.hpp:33
virtual int shutdown() override
Signals peers that we want to close the connections.
Definition: rate_limited_layer.hpp:70
Socket classes for networking.
std::wstring native_string
A string in the system's native character type and encoding. Note: This typedef changes depending on...
Definition: string.hpp:33
A limiter for the attached buckets.
Definition: rate_limiter.hpp:184
Interface for sockets.
Definition: socket.hpp:358
Simple handler for asynchronous event processing.
Definition: event_handler.hpp:54
A rate-limited token bucket.
Definition: rate_limiter.hpp:251
The namespace used by libfilezilla.
Definition: apply.hpp:17