Merror
Bun

method

udp.ConnectedSocketHandler.error

socket: ConnectedSocket<DataBinaryType>,
error: Error
): void | Promise<void>;

Referenced types

interface ConnectedSocket<DataBinaryType extends BinaryType>

  • readonly binaryType: keyof BinaryTypeList
  • readonly closed: boolean
  • readonly hostname: string
  • readonly port: number
  • multicastAddress: string,
    interfaceAddress?: string
    ): boolean;

    Join a multicast group.

    @param multicastAddress

    The multicast group address

    @param interfaceAddress

    Optional interface address to use

    @returns

    true on success

  • sourceAddress: string,
    groupAddress: string,
    interfaceAddress?: string
    ): boolean;

    Join a source-specific multicast group.

    @param sourceAddress

    The source address

    @param groupAddress

    The multicast group address

    @param interfaceAddress

    Optional interface address to use

    @returns

    true on success

  • close(): void;
  • multicastAddress: string,
    interfaceAddress?: string
    ): boolean;

    Leave a multicast group.

    @param multicastAddress

    The multicast group address

    @param interfaceAddress

    Optional interface address to use

    @returns

    true on success

  • sourceAddress: string,
    groupAddress: string,
    interfaceAddress?: string
    ): boolean;

    Leave a source-specific multicast group.

    @param sourceAddress

    The source address

    @param groupAddress

    The multicast group address

    @param interfaceAddress

    Optional interface address to use

    @returns

    true on success

  • ref(): void;
  • handler: ConnectedSocketHandler<DataBinaryType>
    ): void;
  • data: Data
    ): boolean;
  • packets: readonly Data[]
    ): number;
  • enabled: boolean
    ): boolean;

    Enable or disable SO_BROADCAST socket option.

    @param enabled

    Whether to enable broadcast

    @returns

    The enabled value

  • interfaceAddress: string
    ): boolean;

    Set the IP_MULTICAST_IF socket option to specify the outgoing interface for multicast packets.

    @param interfaceAddress

    The address of the interface to use

    @returns

    true on success

  • enabled: boolean
    ): boolean;

    Enable or disable IP_MULTICAST_LOOP socket option.

    @param enabled

    Whether to enable multicast loopback

    @returns

    The enabled value

  • ttl: number
    ): number;

    Set the IP_MULTICAST_TTL socket option.

    @param ttl

    Time to live value for multicast packets

    @returns

    The TTL value

  • ttl: number
    ): number;

    Set the IP_TTL socket option.

    @param ttl

    Time to live value

    @returns

    The TTL value

  • unref(): void;

interface Error