Skip to content
DocsGuidesReferenceBlog
Install
HomeDocsGuidesReferenceBlog
Install Bun v1.3.14
Reference
Modules/node:dgram
  • FcreateSocket
  • CSocket

Modules

  • Bun
  • bun:bundle
  • bun:ffi
  • bun:jsc
  • bun:sqlite
  • bun:test
  • Globals
  • node:assert
  • node:async_hooks
  • node:buffer
  • node:child_process
  • node:cluster
  • node:crypto
  • node:dgram
  • node:diagnostics_channel
  • node:dns
  • node:dns/promises
  • node:events
  • node:ffi
  • node:fs
  • node:fs/promises
  • node:http
  • node:http2
  • node:https
  • node:inspector
  • node:inspector/promises
  • node:module
  • node:net
  • node:os
  • node:path
  • node:perf_hooks
  • node:punycode
  • node:querystring
  • node:quic
  • node:readline
  • node:readline/promises
  • node:stream
  • node:stream/consumers
  • node:stream/iter
  • node:stream/promises
  • node:stream/web
  • node:string_decoder
  • node:test
  • node:test/reporters
  • node:timers/promises
  • node:tls
  • node:trace_events
  • node:tty
  • node:url
  • node:util
  • node:util/types
  • node:v8
  • node:vm
  • node:wasi
  • node:worker_threads
  • node:zlib
  • node:zlib/iter

Node.js module

dgram

The 'node:dgram' module provides an implementation of UDP datagram sockets. It allows sending and receiving UDP packets, creating both IPv4 and IPv6 sockets.

This module is used for lightweight, connectionless communication, such as DNS queries, syslog, and real-time streaming protocols that favor speed over reliability.

Fully supported in Bun›

Fully implemented. > 90% of Node.js's test suite passes.

Functions 1Classes 1Interfaces 4Types 1

Functions 1

  • dgram.createSocket()

    Creates a dgram.Socket object.

Classes 1

  • class dgram.Socket

    Encapsulates the datagram functionality.

Interfaces 4

  • interface BindOptions

  • interface RemoteInfo

  • interface SocketEventMap

  • interface SocketOptions

Types 1

  • type SocketType