|
uvco 0.1
|
Functions | |
| void | uvco::onCloseCallback (uv_handle_t *handle) |
| template<typename Handle> | |
| bool | uvco::isClosed (const Handle *h) |
| template<typename Handle, typename CloserArg> | |
| void | uvco::closeHandle (Handle *handle, void(*closer)(CloserArg *, void(*)(uv_handle_t *))) |
| template<typename Handle> | |
| void | uvco::closeHandle (Handle *handle) |
| Specialization for uv_handle_t handles. | |
Internally used by various classes to safely close and deallocate libuv handles.
| void uvco::closeHandle | ( | Handle * | handle | ) |
Specialization for uv_handle_t handles.
| void uvco::closeHandle | ( | Handle * | handle, |
| void(* | closer )(CloserArg *, void(*)(uv_handle_t *)) ) |
closeHandle() takes care of safely closing a handle. Canonically you should await the returned promise to be sure that the handle is closed. However, if the promise is dropped and thus the coroutine cancelled, the libuv close operation will still be carried out safely in the background.
The template types and arguments are expressed as they are to support, e.g., uv_tcp_close_reset.
closeHandle() has an intricate implementation which allows a safe synchronous call, e.g. from destructors: In that case, the handle will still be closed correctly, but the handle itself will also be freed. This is always done when it detects that the closeHandle coroutine has been cancelled (due to the returned promise having been dropped).
| bool uvco::isClosed | ( | const Handle * | h | ) |
| void uvco::onCloseCallback | ( | uv_handle_t * | handle | ) |