Skip to content

Commit

Permalink
test: clarify dropMembership() call
Browse files Browse the repository at this point in the history
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 <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: #2062
  • Loading branch information
Trott committed Aug 9, 2015
1 parent 2db57bd commit 226b8e0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/internet/test-dgram-multicast-multi-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var common = require('../common'),
assert = require('assert'),
dgram = require('dgram'),
util = require('util'),
assert = require('assert'),
Buffer = require('buffer').Buffer,
fork = require('child_process').fork,
LOCAL_BROADCAST_HOST = '224.0.0.114',
Expand Down Expand Up @@ -183,10 +182,9 @@ if (process.argv[2] === 'child') {
process.send({ message: buf.toString() });

if (receivedMessages.length == messages.length) {
// .dropMembership() not strictly needed but here as a sanity check
listenSocket.dropMembership(LOCAL_BROADCAST_HOST);

process.nextTick(function() { // TODO should be changed to below.
// listenSocket.dropMembership(LOCAL_BROADCAST_HOST, function() {
process.nextTick(function() {
listenSocket.close();
});
}
Expand Down

0 comments on commit 226b8e0

Please sign in to comment.