mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
60898eed65
PR-URL: https://github.com/nodejs/node/pull/43984 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
16 lines
452 B
JavaScript
16 lines
452 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const dgram = require('dgram');
|
|
const dc = require('diagnostics_channel');
|
|
|
|
const udpSocketChannel = dc.channel('udp.socket');
|
|
|
|
const isUDPSocket = (socket) => socket instanceof dgram.Socket;
|
|
|
|
udpSocketChannel.subscribe(common.mustCall(({ socket }) => {
|
|
assert.strictEqual(isUDPSocket(socket), true);
|
|
}));
|
|
const socket = dgram.createSocket('udp4');
|
|
socket.close();
|