uvw
2.10.0
|
The SignalHandle handle. More...
#include <signal.h>
Public Member Functions | |
bool | init () |
Initializes the handle. More... | |
void | start (int signum) |
Starts the handle. More... | |
void | oneShot (int signum) |
Starts the handle. More... | |
void | stop () |
Stops the handle. | |
int | signal () const noexcept |
Gets the signal being monitored. More... | |
![]() | |
HandleCategory | category () const noexcept |
Gets the category of the handle. More... | |
HandleType | type () const noexcept |
Gets the type of the handle. More... | |
bool | active () const noexcept |
Checks if the handle is active. More... | |
bool | closing () const noexcept |
Checks if a handle is closing or closed. More... | |
void | close () noexcept |
Request handle to be closed. More... | |
void | reference () noexcept |
Reference the given handle. More... | |
void | unreference () noexcept |
Unreference the given handle. More... | |
bool | referenced () const noexcept |
Checks if the given handle referenced. More... | |
std::size_t | size () const noexcept |
Returns the size of the underlying handle type. More... | |
int | sendBufferSize () |
Gets the size of the send buffer used for the socket. More... | |
bool | sendBufferSize (int value) |
Sets the size of the send buffer used for the socket. More... | |
int | recvBufferSize () |
Gets the size of the receive buffer used for the socket. More... | |
bool | recvBufferSize (int value) |
Sets the size of the receive buffer used for the socket. More... | |
OSFileDescriptor | fd () const |
Gets the platform dependent file descriptor equivalent. More... | |
![]() | |
template<typename R = void> | |
std::shared_ptr< R > | data () const |
Gets user-defined data. uvw won't use this field in any case. More... | |
void | data (std::shared_ptr< void > uData) |
Sets arbitrary data. uvw won't use this field in any case. More... | |
![]() | |
Loop & | loop () const noexcept |
Gets the loop from which the resource was originated. More... | |
const U * | raw () const noexcept |
Gets the underlying raw data structure. More... | |
U * | raw () noexcept |
Gets the underlying raw data structure. More... | |
![]() | |
template<typename E > | |
Connection< E > | on (Listener< E > f) |
Registers a long-lived listener with the event emitter. More... | |
template<typename E > | |
Connection< E > | once (Listener< E > f) |
Registers a short-lived listener with the event emitter. More... | |
template<typename E > | |
void | erase (Connection< E > conn) noexcept |
Disconnects a listener from the event emitter. More... | |
template<typename E > | |
void | clear () noexcept |
Disconnects all the listeners for the given event type. | |
void | clear () noexcept |
Disconnects all the listeners. | |
template<typename E > | |
bool | empty () const noexcept |
Checks if there are listeners registered for the specific event. More... | |
bool | empty () const noexcept |
Checks if there are listeners registered with the event emitter. More... | |
Additional Inherited Members | |
![]() | |
template<typename... Args> | |
static std::shared_ptr< T > | create (Args &&... args) |
Creates a new resource of the given type. More... | |
The SignalHandle handle.
Signal handles implement Unix style signal handling on a per-event loop bases.
Reception of some signals is emulated on Windows.
To create a SignalHandle
through a Loop
, no arguments are required.
See the official documentation for further details.
bool uvw::SignalHandle::init | ( | ) |
Initializes the handle.
void uvw::SignalHandle::oneShot | ( | int | signum | ) |
Starts the handle.
Same functionality as SignalHandle::start but the signal handler is reset the moment the signal is received.
signum |
|
noexcept |
Gets the signal being monitored.
void uvw::SignalHandle::start | ( | int | signum | ) |
Starts the handle.
The handle will start emitting SignalEvent when needed.
signum | The signal to be monitored. |