constructor()

in src/writer/udp_writer.ts [16:30]


    constructor(location: string, address: string, port: number, logger: Logger = get_logger()) {
        super(logger);
        this._logger.debug(`initialize UdpWriter to ${location}`);
        this._address = address;
        this._port = port;

        if (isIPv6(this._address)) {
            this._family = "udp6";
        } else {
            // IPv4 addresses, and anything that does not appear to be an IPv4 or IPv6 address (i.e. hostnames)
            this._family = "udp4";
        }

        this._socket = createSocket(this._family);
    }