| 334 | } |
| 335 | |
| 336 | int uv_write(uv_stream_t* handle, uv_buf_t const bufs[], unsigned int nbufs, |
| 337 | std::weak_ptr<std::function<void(int)>> cb) |
| 338 | { |
| 339 | auto req = cm::make_unique<write_req>(std::move(cb)); |
| 340 | int status = uv_write(req.get(), handle, bufs, nbufs, write_req_cb); |
| 341 | if (status == 0) { |
| 342 | // Ownership has been transferred to the event loop. |
| 343 | static_cast<void>(req.release()); |
| 344 | } |
| 345 | return status; |
| 346 | } |
| 347 | } |
searching dependent graphs…