Skip to content

Commit

Permalink
dgram: use internal addAbortListener
Browse files Browse the repository at this point in the history
PR-URL: #52081
Refs: #48596
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
atlowChemi authored and marco-ippolito committed May 3, 2024
1 parent 9af15cf commit 27d3644
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const { Buffer } = require('buffer');
const { deprecate, guessHandleType, promisify } = require('internal/util');
const { isArrayBufferView } = require('internal/util/types');
const EventEmitter = require('events');
const { addAbortListener } = require('internal/events/abort_listener');
const {
defaultTriggerAsyncIdScope,
symbols: { async_id_symbol, owner_symbol },
Expand Down Expand Up @@ -146,7 +147,7 @@ function Socket(type, listener) {
if (signal.aborted) {
onAborted();
} else {
const disposable = EventEmitter.addAbortListener(signal, onAborted);
const disposable = addAbortListener(signal, onAborted);
this.once('close', disposable[SymbolDispose]);
}
}
Expand Down

0 comments on commit 27d3644

Please sign in to comment.