Skip to content

Commit cc46d3b

Browse files
Trottrvagg
authored andcommitted
test: clarify dropMembership() call
According to docs, dropMembership() is automatically called by the kernel when the socket is closed, and most apps will never need to call it. It's called here as a sanity check only so let's note that with a comment. Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> PR-URL: #2062
1 parent 7118b8a commit cc46d3b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/internet/test-dgram-multicast-multi-process.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ var common = require('../common'),
33
assert = require('assert'),
44
dgram = require('dgram'),
55
util = require('util'),
6-
assert = require('assert'),
76
Buffer = require('buffer').Buffer,
87
fork = require('child_process').fork,
98
LOCAL_BROADCAST_HOST = '224.0.0.114',
@@ -183,10 +182,9 @@ if (process.argv[2] === 'child') {
183182
process.send({ message: buf.toString() });
184183

185184
if (receivedMessages.length == messages.length) {
185+
// .dropMembership() not strictly needed but here as a sanity check
186186
listenSocket.dropMembership(LOCAL_BROADCAST_HOST);
187-
188-
process.nextTick(function() { // TODO should be changed to below.
189-
// listenSocket.dropMembership(LOCAL_BROADCAST_HOST, function() {
187+
process.nextTick(function() {
190188
listenSocket.close();
191189
});
192190
}

0 commit comments

Comments
 (0)