help icon indicating copy to clipboard operation
help copied to clipboard

How could it be possible that during one `uv_run` read_cb get fired multiple time?

Open winterland1989 opened this issue 8 years ago • 1 comments

I find a strange thing happening: after call uv_read_start, i call uv_run with UV_RUN_NOWAIT, i attached an unique id to each handler to track event happened during uv_run, but sometimes i can see the same handler's uv_read_callback get call multiple times, how is that possible?

I even tried add a uv_read_stop inside read callback, but it seems it's not working.

winterland1989 avatar Jul 26 '17 10:07 winterland1989

Is that on OS X or one of the BSDs? Those platforms can report multiple events for the same file descriptor in a single kevent() syscall. Libuv reports them as-is, it doesn't coalesce them for latency reasons.

bnoordhuis avatar Jul 26 '17 19:07 bnoordhuis