Skip to content

Commit

Permalink
fix udp multicast binding
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Dec 3, 2023
1 parent c76c599 commit fef5716
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const os = require("os");
const cluster = require("cluster");
const kleur = require("kleur");

/**
* Import types
*/

const stopSignals = [
"SIGHUP",
"SIGINT",
Expand Down
6 changes: 3 additions & 3 deletions src/service.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ declare namespace Service {

export type ActionVisibility = "published" | "public" | "protected" | "private";

// export type ActionParamSchema = { [key: string]: any };
export type ActionParamTypes =
| "any"
| "array"
Expand All @@ -83,8 +82,9 @@ declare namespace Service {
| "url"
| "uuid"
| boolean
| string;
// | ActionParamSchema;
| string
| Record<string, any>;

export type ActionParams = { [key: string]: ActionParamTypes };

export type ActionCacheEnabledFunc = (ctx: Context<any, any>) => boolean;
Expand Down
3 changes: 2 additions & 1 deletion src/tracing/span.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function defProp(instance, propName, value, readOnly = false) {
/**
* Trace Span class
*
* @property {Tracer} tracer
* @class Span
* @implements {SpanClass}
*/
Expand All @@ -41,7 +42,7 @@ class Span {
*/
constructor(tracer, name, opts) {
defProp(this, "tracer", tracer, true);
defProp(this, "logger", this.tracer.logger, true);
defProp(this, "logger", tracer.logger, true);
defProp(this, "opts", opts || {});
defProp(this, "meta", {});

Expand Down
2 changes: 1 addition & 1 deletion src/transit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
Regenerator as ErrorRegenerator
} from "./errors";
import { Stream } from "stream";
import { NodeRawInfo } from "./service-broker";
import { NodeRawInfo } from "./registry";

declare namespace Transit {
export interface TransitOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/transporters/tcp/udp-broadcaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class UdpServer extends EventEmitter {

/** @type {import("dgram").BindOptions} */
const bindOptions = { port, exclusive: true };
if (host) {
if (host && !multicastAddress) {
bindOptions.address = host;
}

Expand Down

0 comments on commit fef5716

Please sign in to comment.