improvements
This commit is contained in:
parent
b7f3684c35
commit
e5f2e4bded
@ -31,7 +31,7 @@ public:
|
||||
}
|
||||
|
||||
void start(Callback cb) noexcept {
|
||||
callback = cb;
|
||||
callback = std::move(cb);
|
||||
get<uv_check_t>()->data = this;
|
||||
auto err = uv_check_start(get<uv_check_t>(), &proto);
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ public:
|
||||
using Callback = std::function<void(UVWError)>;
|
||||
|
||||
void close(Callback cb) noexcept {
|
||||
callback = cb;
|
||||
callback = std::move(cb);
|
||||
get<uv_handle_t>()->data = this;
|
||||
uv_close(get<uv_handle_t>(), &proto);
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ public:
|
||||
// TODO shutdown
|
||||
|
||||
void listen(int backlog, CallbackListen cb) noexcept {
|
||||
listenCallback = cb;
|
||||
listenCallback = std::move(cb);
|
||||
this->template get<uv_stream_t>()->data = this;
|
||||
auto err = uv_listen(this->template get<uv_stream_t>(), backlog, &protoListen);
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ public:
|
||||
}
|
||||
|
||||
void start(const Time &timeout, const Time &rep, Callback cb) noexcept {
|
||||
callback = cb;
|
||||
callback = std::move(cb);
|
||||
get<uv_timer_t>()->data = this;
|
||||
auto err = uv_timer_start(get<uv_timer_t>(), &proto, timeout.count(), rep.count());
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user