Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const onMessage = common.mustCall(function(err, bytes) {
client.close();
});

client.send(buf, common.PORT, onMessage);
client.bind(0, () => client.send(buf, client.address().port, onMessage));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a good idea to wrap the callback in common.mustCall().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a bad idea. onMessage() is wrapped in a mustCall(), so in this case not strictly necessary. No strong preference.

Copy link
Member

@Trott Trott May 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah, if onMessage is already wrapped then the additional wrapping suggested by me above is actually not needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I also find common.mustCall() a bit redundant here which is the reason why I didn't suggest it in the first place.