node
node copied to clipboard
dgram: add dgram send queue info
Add getSendQueueSize
and getSendQueueCount
for dgram
.
- [x]
make -j4 test
(UNIX), orvcbuild test
(Windows) passes - [x] tests and/or benchmarks are included
- [x] documentation is changed or added
- [x] commit message follows commit guidelines
Review requested:
- [ ] @nodejs/net
Can you add a test where those are non-zero?
Done ! Thanks !
CI: https://ci.nodejs.org/job/node-test-pull-request/45892/
@mcollina Hi, can help review this PR again ? Thanks !
It failed on Windows.
node:assert:124
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
0 !== 10
It seems windows writes the data into os synchronously.
On other platforms they will insert the request into write queue first and wait POLLOUT
event.
I think it's difficult to simulate this, so i just change the code as follows.
assert.ok(client.getSendQueueSize() >= 0);
assert.ok(client.getSendQueueCount() >= 0);
cc @mcollina
You could make an OS conditional switch. At least this oddity would be transparent for the reader.
Done.
CI: https://ci.nodejs.org/job/node-test-pull-request/45907/
CI: https://ci.nodejs.org/job/node-test-pull-request/45911/
@mcollina Hi , can help review again ? Thanks .
@mcollina Hi , can help review again ?
Landed in 97e8bda5b29561c8c6e30736cd15919403fb7a5b
This depends on https://github.com/nodejs/node/pull/44056, which is not landed yet in v16.x