UNPKG

matterbridge

Version:
65 lines 2.65 kB
/** * @description This file contains the class Multicast. * @file multicast.ts * @author Luca Liguori * @created 2025-03-22 * @version 1.0.0 * @license Apache-2.0 * * Copyright 2025, 2026, 2027 Luca Liguori. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { AddressInfo } from 'node:net'; import { Dgram } from './dgram.js'; export declare const MDNS_MULTICAST_IPV4_ADDRESS = "224.0.0.251"; export declare const MDNS_MULTICAST_IPV6_ADDRESS = "ff02::fb"; export declare const MDNS_MULTICAST_PORT = 5353; export declare const COAP_MULTICAST_IPV4_ADDRESS = "224.0.1.187"; export declare const COAP_MULTICAST_IPV6_ADDRESS = "ff02::fd"; export declare const COAP_MULTICAST_PORT = 5683; /** * This class implements a multicast dgram socket. */ export declare class Multicast extends Dgram { multicastAddress: string; multicastPort: number; joinedInterfaces: string[]; /** * Creates an instance of Multicast. * * @param {string} name - The name of the socket. * @param {string} multicastAddress - The multicast address to join. * @param {number} multicastPort - The port number to bind to. * @param {'udp4' | 'udp6'} socketType - The type of the socket (IPv4 or IPv6). * @param {boolean | undefined} reuseAddr - Whether to allow address reuse. * @param {string} [interfaceName] - The name of the network interface to bind to. * @param {string} [interfaceAddress] - The address of the network interface to bind to. */ constructor(name: string, multicastAddress: string, multicastPort: number, socketType: 'udp4' | 'udp6', reuseAddr?: boolean | undefined, interfaceName?: string, interfaceAddress?: string); /** * Starts the dgram multicast socket. */ start(): void; /** * Event handler for the 'listening' event. This event is emitted when the socket starts listening for datagram messages. * * @param {AddressInfo} [address] - The address info. */ onListening(address: AddressInfo): void; /** * Stops the dgram multicast socket. */ stop(): void; } //# sourceMappingURL=multicast.d.ts.map