0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-dgram-abort-closed.js
Ramana Venkata 65d2a4247b
dgram: fix unhandled exception aborting a closed udp socket
Fixes: https://github.com/nodejs/node/issues/46750
PR-URL: https://github.com/nodejs/node/pull/46770
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-02-25 10:22:05 +00:00

11 lines
229 B
JavaScript

'use strict';
require('../common');
const dgram = require('dgram');
const controller = new AbortController();
const socket = dgram.createSocket({ type: 'udp4', signal: controller.signal });
socket.close();
controller.abort();