Skip to content

dgram: call send callback asynchronously

According to this issue https://github.com/iojs/io.js/pull/486, every callbacks should be called asynchronously, But dgram.send callback is not called asynchronously.

We can not run full benchmark test. benchmark/net/dgram.js uses send callback recursively. But send callback is not asynchronous, the recursive callback goes infinite loop.

If this fix is accepted, we could run full benchmark test on every release.

I think libuv changes the uv_udp_send API on this commit https://github.com/libuv/libuv/commit/41891222bca4e985bef45515fe131fbdbec3f969.

So I just fixed callback asynchronously using setImmediate.

Merge request reports

Loading