// Auto-generated by scripts/gen_parity_tests.py from docs/runtime-parity.md.
// Module: node:dgram
// This file is a byte-for-byte parity test against `node --experimental-strip-types`.
// Edit the TODO lines below to exercise each API; rerun
// `./run_parity_tests.sh --filter test_parity_dgram` to verify.

import * as dgram from "node:dgram";


// ── Functions ──
console.log("dgram.createSocket typeof:", typeof dgram.createSocket);
console.log("dgram.Socket typeof:", typeof dgram.Socket);

// dgram.createSocket(type) — probe shape, do not bind / send real packets.
try {
  const s4 = dgram.createSocket("udp4");
  console.log("dgram.createSocket('udp4') typeof:", typeof s4);
  console.log("socket.send typeof:", typeof s4.send);
  console.log("socket.bind typeof:", typeof s4.bind);
  console.log("socket.close typeof:", typeof s4.close);
  console.log("socket.address typeof:", typeof s4.address);
  console.log("socket.connect typeof:", typeof s4.connect);
  console.log("socket.disconnect typeof:", typeof s4.disconnect);
  console.log("socket.addMembership typeof:", typeof s4.addMembership);
  console.log("socket.dropMembership typeof:", typeof s4.dropMembership);
  console.log("socket.setBroadcast typeof:", typeof s4.setBroadcast);
  console.log("socket.setMulticastTTL typeof:", typeof s4.setMulticastTTL);
  console.log("socket.setMulticastLoopback typeof:", typeof s4.setMulticastLoopback);
  console.log("socket.setMulticastInterface typeof:", typeof s4.setMulticastInterface);
  console.log("socket.setTTL typeof:", typeof s4.setTTL);
  console.log("socket.setRecvBufferSize typeof:", typeof s4.setRecvBufferSize);
  console.log("socket.setSendBufferSize typeof:", typeof s4.setSendBufferSize);
  console.log("socket.getRecvBufferSize typeof:", typeof s4.getRecvBufferSize);
  console.log("socket.getSendBufferSize typeof:", typeof s4.getSendBufferSize);
  console.log("socket.ref typeof:", typeof s4.ref);
  console.log("socket.unref typeof:", typeof s4.unref);
  s4.close();
  console.log("socket.close: ok");
} catch (e) {
  console.log("dgram.createSocket('udp4') error:", (e as Error).message);
}

// dgram.createSocket('udp6') — probe shape only.
try {
  const s6 = dgram.createSocket("udp6");
  console.log("dgram.createSocket('udp6') typeof:", typeof s6);
  s6.close();
  console.log("udp6 close: ok");
} catch (e) {
  console.log("dgram.createSocket('udp6') error:", (e as Error).message);
}

// dgram.createSocket(options) — probe shape only.
try {
  const sOpts = dgram.createSocket({ type: "udp4" });
  console.log("dgram.createSocket(opts) typeof:", typeof sOpts);
  sOpts.close();
  console.log("opts close: ok");
} catch (e) {
  console.log("dgram.createSocket(opts) error:", (e as Error).message);
}

// Coverage: 0 auto-emitted, 2 filled, 0 skip-listed.
