Skip to content

Commit

Permalink
stronger optional
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Dec 18, 2024
1 parent ee7bbf9 commit ab2aa51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,14 @@ module.exports = class UDXSocket extends events.EventEmitter {
return binding.udx_napi_socket_set_send_buffer_size(this._handle, size)
}

addMembership (group, ifaceAddress = '') {
addMembership (group, ifaceAddress) {
if (!this._inited) throw new Error('Socket not active')
return binding.udx_napi_socket_set_membership(this._handle, group, ifaceAddress, true)
return binding.udx_napi_socket_set_membership(this._handle, group, ifaceAddress || '', true)
}

dropMembership (group, ifaceAddress = '') {
dropMembership (group, ifaceAddress) {
if (!this._inited) throw new Error('Socket not active')
return binding.udx_napi_socket_set_membership(this._handle, group, ifaceAddress, false)
return binding.udx_napi_socket_set_membership(this._handle, group, ifaceAddress || '', false)
}

async send (buffer, port, host, ttl) {
Expand Down

0 comments on commit ab2aa51

Please sign in to comment.