Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fixup: param order
  • Loading branch information
apapirovski committed Jun 5, 2018
commit c37af9258235feb3266039d9dd3a7bc4bf93efc8
6 changes: 3 additions & 3 deletions lib/internal/socket_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SocketListSend extends EventEmitter {
child.once('exit', () => this.emit('exit', this));
}

_request(msg, cmd, callback, swallowErrors = false) {
_request(msg, cmd, swallowErrors, callback) {
var self = this;

if (!this.child.connected) return onclose();
Expand All @@ -40,14 +40,14 @@ class SocketListSend extends EventEmitter {
this._request({
cmd: 'NODE_SOCKET_NOTIFY_CLOSE',
key: this.key
}, 'NODE_SOCKET_ALL_CLOSED', callback, true);
}, 'NODE_SOCKET_ALL_CLOSED', true, callback);
}

getConnections(callback) {
this._request({
cmd: 'NODE_SOCKET_GET_COUNT',
key: this.key
}, 'NODE_SOCKET_COUNT', function(err, msg) {
}, 'NODE_SOCKET_COUNT', false, function(err, msg) {
if (err) return callback(err);
callback(null, msg.count);
});
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-internal-socket-list-send.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const key = 'test-key';

const list = new SocketListSend(child, 'test');

list._request('msg', 'cmd', common.mustCall((err) => {
list._request('msg', 'cmd', false, common.mustCall((err) => {
common.expectsError({
code: 'ERR_CHILD_CLOSED_BEFORE_REPLY',
type: Error,
Expand All @@ -39,7 +39,7 @@ const key = 'test-key';

const list = new SocketListSend(child, key);

list._request('msg', 'cmd', common.mustCall((err, msg) => {
list._request('msg', 'cmd', false, common.mustCall((err, msg) => {
assert.strictEqual(err, null);
assert.strictEqual(msg.cmd, 'cmd');
assert.strictEqual(msg.key, key);
Expand All @@ -58,7 +58,7 @@ const key = 'test-key';

const list = new SocketListSend(child, key);

list._request('msg', 'cmd', common.mustCall((err) => {
list._request('msg', 'cmd', false, common.mustCall((err) => {
common.expectsError({
code: 'ERR_CHILD_CLOSED_BEFORE_REPLY',
type: Error,
Expand Down