uvw 3.1.0
|
Handle base class. More...
#include <handle.hpp>
Public Member Functions | |
handle_category | category () const noexcept |
Gets the category of the handle. | |
handle_type | type () const noexcept |
Gets the type of the handle. | |
bool | active () const noexcept |
Checks if the handle is active. | |
bool | closing () const noexcept |
Checks if a handle is closing or closed. | |
void | close () noexcept |
Request handle to be closed. | |
void | reference () noexcept |
Reference the given handle. | |
void | unreference () noexcept |
Unreference the given handle. | |
bool | referenced () const noexcept |
Checks if the given handle referenced. | |
std::size_t | size () const noexcept |
Returns the size of the underlying handle type. | |
int | send_buffer_size () |
Gets the size of the send buffer used for the socket. | |
int | send_buffer_size (int value) |
Sets the size of the send buffer used for the socket. | |
int | recv_buffer_size () |
Gets the size of the receive buffer used for the socket. | |
int | recv_buffer_size (int value) |
Sets the size of the receive buffer used for the socket. | |
os_file_descriptor | fd () const |
Gets the platform dependent file descriptor equivalent. | |
![]() | |
std::shared_ptr< R > | data () const |
Gets user-defined data. uvw won't use this field in any case. | |
void | data (std::shared_ptr< void > udata) |
Sets arbitrary data. uvw won't use this field in any case. | |
![]() | |
virtual int | init () |
Initializes the handle. | |
loop & | parent () const noexcept |
Gets the loop from which the resource was originated. | |
const U * | raw () const noexcept |
Gets the underlying raw data structure. | |
U * | raw () noexcept |
Gets the underlying raw data structure. | |
![]() | |
void | on (listener_t< U > f) |
Registers a long-lived listener with the event emitter. | |
void | reset () noexcept |
Disconnects the listener for the given event type. | |
void | reset () noexcept |
Disconnects all listeners. | |
bool | has () const noexcept |
Checks if there is a listener registered for the specific event. | |
Handle base class.
Base type for all uvw
handle types.
Definition at line 23 of file handle.hpp.
|
inlinenoexcept |
Checks if the handle is active.
What active means depends on the type of handle:
start()
.Rule of thumb: if a handle of type foo_handle
has a start()
member method, then it’s active from the moment that method is called. Likewise, stop()
deactivates the handle again.
Definition at line 88 of file handle.hpp.
|
inlinenoexcept |
Gets the category of the handle.
A base handle offers no functionality to promote it to the actual handle type. By means of this function, an opaque value that identifies the category of the handle is made available to the users.
Definition at line 52 of file handle.hpp.
|
inlinenoexcept |
Request handle to be closed.
This must be called on each handle before memory is released.
In-progress requests are cancelled and this can result in errors.
The handle will emit a close event when finished.
Definition at line 112 of file handle.hpp.
|
inlinenoexcept |
Checks if a handle is closing or closed.
This function should only be used between the initialization of the handle and the arrival of the close callback.
Definition at line 100 of file handle.hpp.
|
inline |
Gets the platform dependent file descriptor equivalent.
Supported handles:
If invoked on a different handle, one that doesn’t have an attached file descriptor yet or one which was closed, an invalid value is returned.
See the official documentation for further details.
Definition at line 241 of file handle.hpp.
|
inline |
Gets the size of the receive buffer used for the socket.
Gets the size of the receive buffer that the operating system uses for the socket.
This function works for tcp, pipe and udp handles on Unix and for tcp and udp handles on Windows.
Note that Linux will return double the size of the original set value.
Definition at line 199 of file handle.hpp.
|
inline |
Sets the size of the receive buffer used for the socket.
Sets the size of the receive buffer that the operating system uses for the socket.
This function works for tcp, pipe and udp handles on Unix and for tcp and udp handles on Windows.
Note that Linux will set double the size.
Definition at line 216 of file handle.hpp.
|
inlinenoexcept |
Reference the given handle.
References are idempotent, that is, if a handle is already referenced calling this function again will have no effect.
Definition at line 124 of file handle.hpp.
|
inlinenoexcept |
Checks if the given handle referenced.
Definition at line 142 of file handle.hpp.
|
inline |
Gets the size of the send buffer used for the socket.
Gets the size of the send buffer that the operating system uses for the socket.
This function works for tcp, pipeand udp handles on Unix and for tcp and udp handles on Windows.
Note that Linux will return double the size of the original set value.
Definition at line 166 of file handle.hpp.
|
inline |
Sets the size of the send buffer used for the socket.
Sets the size of the send buffer that the operating system uses for the socket.
This function works for tcp, pipe and udp handles on Unix and for tcp and udp handles on Windows.
Note that Linux will set double the size.
Definition at line 183 of file handle.hpp.
|
inlinenoexcept |
Returns the size of the underlying handle type.
Definition at line 150 of file handle.hpp.
|
inlinenoexcept |
Gets the type of the handle.
A base handle offers no functionality to promote it to the actual handle type. By means of this function, the type of the underlying handle as specified by handle_type is made available to the users.
Definition at line 65 of file handle.hpp.
|
inlinenoexcept |
Unreference the given handle.
References are idempotent, that is, if a handle is not referenced calling this function again will have no effect.
Definition at line 134 of file handle.hpp.