Socket
Socket
Sign inDemoInstall

@foxglove/rtps

Package Overview
Dependencies
4
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.1 to 1.2.2

3

dist/common/enums.d.ts

@@ -86,3 +86,4 @@ export declare enum EncapsulationKind {

UDPv4 = 1,
UDPv6 = 2
UDPv6 = 2,
Unknown = 16
}

@@ -89,0 +90,0 @@ export declare enum VendorId {

@@ -101,2 +101,3 @@ "use strict";

LocatorKind[LocatorKind["UDPv6"] = 2] = "UDPv6";
LocatorKind[LocatorKind["Unknown"] = 16] = "Unknown";
})(LocatorKind = exports.LocatorKind || (exports.LocatorKind = {}));

@@ -103,0 +104,0 @@ var VendorId;

@@ -26,6 +26,9 @@ "use strict";

const [guidPrefix, entityId] = common_1.guidParts(participantGuid);
const metatrafficUnicastLocatorList = metatrafficUnicastLocator != undefined ? [metatrafficUnicastLocator] : [];
const metatrafficMulticastLocatorList = metatrafficMulticastLocator != undefined ? [metatrafficMulticastLocator] : [];
const defaultUnicastLocatorList = defaultUnicastLocator != undefined ? [defaultUnicastLocator] : [];
const defaultMulticastLocatorList = defaultMulticastLocator != undefined ? [defaultMulticastLocator] : [];
const metatrafficUnicastLocatorList = filterLocators(metatrafficUnicastLocator);
const metatrafficMulticastLocatorList = filterLocators(metatrafficMulticastLocator);
const defaultUnicastLocatorList = filterLocators(defaultUnicastLocator);
const defaultMulticastLocatorList = filterLocators(defaultMulticastLocator);
if (defaultUnicastLocatorList.length === 0) {
return undefined;
}
return {

@@ -84,2 +87,7 @@ timestamp,

exports.parseEndpoint = parseEndpoint;
function filterLocators(locators) {
const udp4 = locators.filter((locator) => locator.kind === common_1.LocatorKind.UDPv4);
const udp6 = locators.filter((locator) => locator.kind === common_1.LocatorKind.UDPv6);
return udp4.concat(udp6);
}
//# sourceMappingURL=simple.js.map

@@ -93,12 +93,16 @@ "use strict";

expect(allParams.get(common_1.ParameterId.PID_DOMAIN_ID)).toEqual(0);
expect(allParams.get(common_1.ParameterId.PID_DEFAULT_UNICAST_LOCATOR)).toEqual({
kind: common_1.LocatorKind.UDPv4,
port: 58584,
address: "10.0.0.46",
});
expect(allParams.get(common_1.ParameterId.PID_METATRAFFIC_UNICAST_LOCATOR)).toEqual({
kind: common_1.LocatorKind.UDPv4,
port: 58584,
address: "10.0.0.46",
});
expect(allParams.get(common_1.ParameterId.PID_DEFAULT_UNICAST_LOCATOR)).toEqual([
{
kind: common_1.LocatorKind.UDPv4,
port: 58584,
address: "10.0.0.46",
},
]);
expect(allParams.get(common_1.ParameterId.PID_METATRAFFIC_UNICAST_LOCATOR)).toEqual([
{
kind: common_1.LocatorKind.UDPv4,
port: 58584,
address: "10.0.0.46",
},
]);
expect(allParams.get(common_1.ParameterId.PID_ADLINK_PARTICIPANT_VERSION_INFO)).toEqual("Johns-MacBook-Pro.local/0.8.0/Darwin/Darwin"); // prettier-ignore

@@ -105,0 +109,0 @@ expect(allParams.get(common_1.ParameterId.PID_SAMPLE_SIGNATURE)).toEqual(new Uint8Array([0, 0, 0x10, 0])); // prettier-ignore

@@ -23,6 +23,6 @@ import { CdrReader } from "@foxglove/cdr";

domainId(): number | undefined;
defaultUnicastLocator(): Locator | undefined;
defaultMulticastLocator(): Locator | undefined;
metatrafficUnicastLocator(): Locator | undefined;
metatrafficMulticastLocator(): Locator | undefined;
defaultUnicastLocator(): Locator[];
defaultMulticastLocator(): Locator[];
metatrafficUnicastLocator(): Locator[];
metatrafficMulticastLocator(): Locator[];
expectsInlineQoS(): boolean;

@@ -29,0 +29,0 @@ static FromCdr(serializedData: Uint8Array): ParametersView | undefined;

@@ -17,3 +17,13 @@ "use strict";

const value = getParameterValue(parameterId, parameterLength, reader);
this.map.set(parameterId, value);
if (isMultiParameter(parameterId)) {
let array = this.map.get(parameterId);
if (array == undefined) {
array = [];
this.map.set(parameterId, array);
}
array.push(value);
}
else {
this.map.set(parameterId, value);
}
}

@@ -74,12 +84,12 @@ }

defaultUnicastLocator() {
return this.map.get(common_1.ParameterId.PID_DEFAULT_UNICAST_LOCATOR);
return this.map.get(common_1.ParameterId.PID_DEFAULT_UNICAST_LOCATOR) ?? [];
}
defaultMulticastLocator() {
return this.map.get(common_1.ParameterId.PID_DEFAULT_MULTICAST_LOCATOR);
return this.map.get(common_1.ParameterId.PID_DEFAULT_MULTICAST_LOCATOR) ?? [];
}
metatrafficUnicastLocator() {
return this.map.get(common_1.ParameterId.PID_METATRAFFIC_UNICAST_LOCATOR);
return (this.map.get(common_1.ParameterId.PID_METATRAFFIC_UNICAST_LOCATOR) ?? []);
}
metatrafficMulticastLocator() {
return this.map.get(common_1.ParameterId.PID_METATRAFFIC_MULTICAST_LOCATOR);
return (this.map.get(common_1.ParameterId.PID_METATRAFFIC_MULTICAST_LOCATOR) ?? []);
}

@@ -208,2 +218,8 @@ expectsInlineQoS() {

}
function isMultiParameter(parameterId) {
return (parameterId === common_1.ParameterId.PID_DEFAULT_UNICAST_LOCATOR ||
parameterId === common_1.ParameterId.PID_DEFAULT_MULTICAST_LOCATOR ||
parameterId === common_1.ParameterId.PID_METATRAFFIC_UNICAST_LOCATOR ||
parameterId === common_1.ParameterId.PID_METATRAFFIC_MULTICAST_LOCATOR);
}
//# sourceMappingURL=ParametersView.js.map

@@ -51,3 +51,4 @@ import { EventEmitter } from "eventemitter3";

sendAlive(manual?: boolean): Promise<void>;
sendChanges(writer: Writer): Promise<void>;
sendDefaultChanges(writer: Writer): Promise<void>;
sendMetatrafficChanges(writer: Writer): Promise<void>;
sendChangesTo(reader: ReaderView, writer: Writer, locators: Locator[]): Promise<void>;

@@ -64,2 +65,4 @@ subscribe(opts: SubscribeOpts): EntityId;

private getReaders;
private readerName;
private writerName;
private handleError;

@@ -66,0 +69,0 @@ private handleUdpMessage;

@@ -87,3 +87,3 @@ "use strict";

this.handleHeartbeat = (guidPrefix, heartbeat) => {
this._log?.debug?.(` [SUBMSG] HEARTBEAT reader=${common_1.uint32ToHex(heartbeat.readerEntityId)} writer=${common_1.uint32ToHex(heartbeat.writerEntityId)} ${heartbeat.firstAvailableSeqNumber},${heartbeat.lastSeqNumber} (count=${heartbeat.count}, liveliness=${heartbeat.liveliness}, final=${heartbeat.final})`);
this._log?.debug?.(` [SUBMSG] HEARTBEAT reader=${this.readerName(heartbeat.readerEntityId)} writer=${this.writerName(heartbeat.writerEntityId)} seq=${heartbeat.firstAvailableSeqNumber},${heartbeat.lastSeqNumber} (count=${heartbeat.count}, liveliness=${heartbeat.liveliness}, final=${heartbeat.final})`);
const srcSocket = this._unicastSocket;

@@ -121,3 +121,3 @@ if (srcSocket == undefined) {

const gapEnd = gapList.base - 1n;
this._log?.debug?.(` [SUBMSG] GAP reader=${common_1.uint32ToHex(readerEntityId)} writer=${common_1.uint32ToHex(writerEntityId)} gapStart=${gapStart}, gapEnd=${gapEnd}, list=${gapList.toString()}`);
this._log?.debug?.(` [SUBMSG] GAP reader=${this.readerName(readerEntityId)} writer=${this.writerName(writerEntityId)} gapStart=${gapStart}, gapEnd=${gapEnd}, list=${gapList.toString()}`);
const srcSocket = this._unicastSocket;

@@ -145,3 +145,3 @@ if (srcSocket == undefined) {

this.handleAckNack = (guidPrefix, ackNack) => {
this._log?.debug?.(` [SUBMSG] ACKNACK reader=${common_1.uint32ToHex(ackNack.readerEntityId)} writer=${common_1.uint32ToHex(ackNack.writerEntityId)} ${ackNack.readerSNState.toString()}`);
this._log?.debug?.(` [SUBMSG] ACKNACK reader=${this.readerName(ackNack.readerEntityId)} writer=${this.writerName(ackNack.writerEntityId)} ${ackNack.readerSNState.toString()}`);
const srcSocket = this._unicastSocket;

@@ -167,3 +167,3 @@ if (srcSocket == undefined) {

}
void this.sendChangesTo(readerView, writer, participant.attributes.defaultUnicastLocatorList);
void this.sendChangesTo(readerView, writer, participant.attributes.metatrafficUnicastLocatorList);
};

@@ -179,3 +179,3 @@ this.handleDataMsg = (guidPrefix, dataMsg) => {

const readers = this.getReaders(readerEntityId, writerGuid);
this._log?.debug?.(` [SUBMSG] DATA reader=${common_1.uint32ToHex(readerEntityId)} writer=${common_1.uint32ToHex(writerEntityId)} ${data.length} bytes (seq ${sequenceNumber}) from ${writerGuid}, ${readers.length} reader(s)`);
this._log?.debug?.(` [SUBMSG] DATA reader=${this.readerName(readerEntityId)} writer=${this.writerName(writerEntityId)} ${data.length} bytes (seq ${sequenceNumber}) from ${writerGuid}, ${readers.length} reader(s)`);
let instanceHandle;

@@ -282,3 +282,3 @@ switch (writerEntityId) {

for (const reader of readers) {
void this.sendChangesTo(reader, writer, participant.attributes.defaultUnicastLocatorList);
void this.sendChangesTo(reader, writer, participant.attributes.metatrafficUnicastLocatorList);
}

@@ -459,5 +459,6 @@ }

// Create the unicast UDP socket for sending and receiving directly to participants
this._unicastSocket = await transport_1.createUdpSocket(address, this._udpSocketCreate, this.handleUdpMessage, this.handleError);
const locator = await transport_1.locatorForSocket(this._unicastSocket);
if (locator != undefined) {
this._unicastSocket = await transport_1.createUdpSocket(undefined, this._udpSocketCreate, this.handleUdpMessage, this.handleError);
const listenAddr = await this._unicastSocket.localAddress();
if (listenAddr != undefined) {
const locator = transport_1.locatorFromUdpAddress({ address, family: "IPv4", port: listenAddr.port });
this._log?.debug?.(`listening on UDP ${locator.address}:${locator.port}`);

@@ -520,5 +521,5 @@ this.attributes.defaultUnicastLocatorList = [locator];

});
await this.sendChanges(writer);
await this.sendMetatrafficChanges(writer);
}
async sendChanges(writer) {
async sendDefaultChanges(writer) {
const promises = [];

@@ -533,2 +534,12 @@ for (const participant of this._participants.values()) {

}
async sendMetatrafficChanges(writer) {
const promises = [];
for (const participant of this._participants.values()) {
const readers = participant.remoteReadersForWriterId(writer.attributes.entityId);
for (const reader of readers) {
promises.push(this.sendChangesTo(reader, writer, participant.attributes.metatrafficUnicastLocatorList));
}
}
await Promise.all(promises);
}
async sendChangesTo(reader, writer, locators) {

@@ -585,4 +596,4 @@ const srcSocket = this._unicastSocket;

msg.writeSubmessage(new submessages_1.Heartbeat(readerEntityId, writerEntityId, firstSeq, lastSeq, ++reader.count, submessages_1.HeartbeatFlags.Final));
this._log?.debug?.(`sending ${changes.length} change(s) (${msg.size} bytes), reader=${this.readerName(readerEntityId)}, writer=${this.writerName(writerEntityId)}`);
// Send this message as a UDP packet
this._log?.debug?.(`sending ${changes.length} change(s) (${msg.size} bytes), reader=${common_1.uint32ToHex(readerEntityId)}, writer=${common_1.uint32ToHex(writerEntityId)}`);
await transport_1.sendMessageToUdp(msg, srcSocket, locators);

@@ -627,3 +638,3 @@ }

});
void this.sendChanges(writer);
void this.sendMetatrafficChanges(writer);
return readerEntityId;

@@ -669,3 +680,3 @@ }

});
void this.sendChanges(writer);
void this.sendMetatrafficChanges(writer);
return true;

@@ -703,3 +714,3 @@ }

});
await this.sendChanges(writer);
await this.sendMetatrafficChanges(writer);
}

@@ -742,3 +753,3 @@ async broadcastParticipant(attributes) {

this._log?.debug?.(`unadvertising participant ${guidPrefix}`);
await this.sendChanges(writer);
await this.sendMetatrafficChanges(writer);
}

@@ -763,2 +774,7 @@ topicWriters() {

const sequenceNumSet = reader.history.heartbeatUpdate(firstAvailableSeqNumber, lastSeqNumber);
// If there are no sequence numbers to acknowledge, do not send an ACKNACK.
// Doing so will enter an infinite loop with FastRTPS
if (sequenceNumSet.base === 0n) {
return;
}
// If the final flag is set and we have no missing sequence numbers, do not send an ACKNACK

@@ -824,2 +840,13 @@ if (final && sequenceNumSet.empty()) {

}
readerName(readerEntityId) {
const name = this._subscriptions.get(readerEntityId)?.topicName ??
common_1.EntityIdBuiltin[readerEntityId] ??
common_1.EntityKind[readerEntityId & 0xff] ??
"(unknown)";
return `${name} [${common_1.uint32ToHex(readerEntityId)}]`;
}
writerName(writerEntityId) {
const name = common_1.EntityIdBuiltin[writerEntityId] ?? common_1.EntityKind[writerEntityId & 0xff] ?? "(unknown)";
return `${name} [${common_1.uint32ToHex(writerEntityId)}]`;
}
async sendInitialHeartbeats(participant) {

@@ -826,0 +853,0 @@ const srcSocket = this._unicastSocket;

@@ -13,3 +13,3 @@ "use strict";

const readerGuid = common_1.makeGuid(localAttributes.guidPrefix, readerEntityId);
log?.info?.(`Creating reader ${readerGuid} -> ${writerView.guid()} for ${subscription.topicName}`);
log?.info?.(`creating reader ${readerGuid} -> ${writerView.guid()} for ${subscription.topicName}`);
const reader = new Reader_1.Reader({

@@ -16,0 +16,0 @@ guidPrefix: localAttributes.guidPrefix,

{
"name": "@foxglove/rtps",
"version": "1.2.1",
"version": "1.2.2",
"description": "Real-Time Publish Subscribe (DDS-RTPS) protocol implementation with a pluggable transport layer. This is a subset of the complete specification optimized for ROS 2 (Robot Operating System) connections",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -5,2 +5,4 @@ # @foxglove/rtps

[![npm version](https://img.shields.io/npm/v/@foxglove/rtps.svg?style=flat)](https://www.npmjs.com/package/@foxglove/rtps)
## Usage

@@ -7,0 +9,0 @@

@@ -97,2 +97,3 @@ export enum EncapsulationKind {

UDPv6 = 2,
Unknown = 16,
}

@@ -99,0 +100,0 @@

import { Time } from "@foxglove/rostime";
import { ParticipantAttributes } from "../ParticipantAttributes";
import { guidParts, HistoryKind } from "../common";
import { guidParts, HistoryKind, Locator, LocatorKind } from "../common";
import { ParametersView } from "../messaging";

@@ -37,11 +37,11 @@ import { EndpointAttributes } from "../routing";

const metatrafficUnicastLocatorList =
metatrafficUnicastLocator != undefined ? [metatrafficUnicastLocator] : [];
const metatrafficMulticastLocatorList =
metatrafficMulticastLocator != undefined ? [metatrafficMulticastLocator] : [];
const defaultUnicastLocatorList =
defaultUnicastLocator != undefined ? [defaultUnicastLocator] : [];
const defaultMulticastLocatorList =
defaultMulticastLocator != undefined ? [defaultMulticastLocator] : [];
const metatrafficUnicastLocatorList = filterLocators(metatrafficUnicastLocator);
const metatrafficMulticastLocatorList = filterLocators(metatrafficMulticastLocator);
const defaultUnicastLocatorList = filterLocators(defaultUnicastLocator);
const defaultMulticastLocatorList = filterLocators(defaultMulticastLocator);
if (defaultUnicastLocatorList.length === 0) {
return undefined;
}
return {

@@ -108,1 +108,7 @@ timestamp,

}
function filterLocators(locators: Locator[]): Locator[] {
const udp4 = locators.filter((locator) => locator.kind === LocatorKind.UDPv4);
const udp6 = locators.filter((locator) => locator.kind === LocatorKind.UDPv6);
return udp4.concat(udp6);
}

@@ -109,12 +109,16 @@ import {

expect(allParams.get(ParameterId.PID_DOMAIN_ID)).toEqual(0);
expect(allParams.get(ParameterId.PID_DEFAULT_UNICAST_LOCATOR)).toEqual({
kind: LocatorKind.UDPv4,
port: 58584,
address: "10.0.0.46",
});
expect(allParams.get(ParameterId.PID_METATRAFFIC_UNICAST_LOCATOR)).toEqual({
kind: LocatorKind.UDPv4,
port: 58584,
address: "10.0.0.46",
});
expect(allParams.get(ParameterId.PID_DEFAULT_UNICAST_LOCATOR)).toEqual([
{
kind: LocatorKind.UDPv4,
port: 58584,
address: "10.0.0.46",
},
]);
expect(allParams.get(ParameterId.PID_METATRAFFIC_UNICAST_LOCATOR)).toEqual([
{
kind: LocatorKind.UDPv4,
port: 58584,
address: "10.0.0.46",
},
]);
expect(allParams.get(ParameterId.PID_ADLINK_PARTICIPANT_VERSION_INFO)).toEqual("Johns-MacBook-Pro.local/0.8.0/Darwin/Darwin"); // prettier-ignore

@@ -121,0 +125,0 @@ expect(allParams.get(ParameterId.PID_SAMPLE_SIGNATURE)).toEqual(new Uint8Array([0, 0, 0x10, 0])); // prettier-ignore

@@ -35,3 +35,12 @@ import { CdrReader, EncapsulationKind } from "@foxglove/cdr";

const value = getParameterValue(parameterId, parameterLength, reader);
this.map.set(parameterId, value);
if (isMultiParameter(parameterId)) {
let array = this.map.get(parameterId) as unknown[];
if (array == undefined) {
array = [];
this.map.set(parameterId, array);
}
array.push(value);
} else {
this.map.set(parameterId, value);
}
}

@@ -108,16 +117,20 @@ }

defaultUnicastLocator(): Locator | undefined {
return this.map.get(ParameterId.PID_DEFAULT_UNICAST_LOCATOR) as Locator | undefined;
defaultUnicastLocator(): Locator[] {
return (this.map.get(ParameterId.PID_DEFAULT_UNICAST_LOCATOR) as Locator[] | undefined) ?? [];
}
defaultMulticastLocator(): Locator | undefined {
return this.map.get(ParameterId.PID_DEFAULT_MULTICAST_LOCATOR) as Locator | undefined;
defaultMulticastLocator(): Locator[] {
return (this.map.get(ParameterId.PID_DEFAULT_MULTICAST_LOCATOR) as Locator[] | undefined) ?? [];
}
metatrafficUnicastLocator(): Locator | undefined {
return this.map.get(ParameterId.PID_METATRAFFIC_UNICAST_LOCATOR) as Locator | undefined;
metatrafficUnicastLocator(): Locator[] {
return (
(this.map.get(ParameterId.PID_METATRAFFIC_UNICAST_LOCATOR) as Locator[] | undefined) ?? []
);
}
metatrafficMulticastLocator(): Locator | undefined {
return this.map.get(ParameterId.PID_METATRAFFIC_MULTICAST_LOCATOR) as Locator | undefined;
metatrafficMulticastLocator(): Locator[] {
return (
(this.map.get(ParameterId.PID_METATRAFFIC_MULTICAST_LOCATOR) as Locator[] | undefined) ?? []
);
}

@@ -249,1 +262,10 @@

}
function isMultiParameter(parameterId: ParameterId): boolean {
return (
parameterId === ParameterId.PID_DEFAULT_UNICAST_LOCATOR ||
parameterId === ParameterId.PID_DEFAULT_MULTICAST_LOCATOR ||
parameterId === ParameterId.PID_METATRAFFIC_UNICAST_LOCATOR ||
parameterId === ParameterId.PID_METATRAFFIC_MULTICAST_LOCATOR
);
}

@@ -74,3 +74,2 @@ import { CdrReader } from "@foxglove/cdr";

discoveryMulticastPort,
locatorForSocket,
locatorFromUdpAddress,

@@ -221,3 +220,3 @@ MULTICAST_IPv4,

this._unicastSocket = await createUdpSocket(
address,
undefined,
this._udpSocketCreate,

@@ -227,4 +226,5 @@ this.handleUdpMessage,

);
const locator = await locatorForSocket(this._unicastSocket);
if (locator != undefined) {
const listenAddr = await this._unicastSocket.localAddress();
if (listenAddr != undefined) {
const locator = locatorFromUdpAddress({ address, family: "IPv4", port: listenAddr.port });
this._log?.debug?.(`listening on UDP ${locator.address}:${locator.port}`);

@@ -299,6 +299,6 @@ this.attributes.defaultUnicastLocatorList = [locator];

await this.sendChanges(writer);
await this.sendMetatrafficChanges(writer);
}
async sendChanges(writer: Writer): Promise<void> {
async sendDefaultChanges(writer: Writer): Promise<void> {
const promises: Promise<void>[] = [];

@@ -316,2 +316,15 @@ for (const participant of this._participants.values()) {

async sendMetatrafficChanges(writer: Writer): Promise<void> {
const promises: Promise<void>[] = [];
for (const participant of this._participants.values()) {
const readers = participant.remoteReadersForWriterId(writer.attributes.entityId);
for (const reader of readers) {
promises.push(
this.sendChangesTo(reader, writer, participant.attributes.metatrafficUnicastLocatorList),
);
}
}
await Promise.all(promises);
}
async sendChangesTo(reader: ReaderView, writer: Writer, locators: Locator[]): Promise<void> {

@@ -399,8 +412,9 @@ const srcSocket = this._unicastSocket;

// Send this message as a UDP packet
this._log?.debug?.(
`sending ${changes.length} change(s) (${msg.size} bytes), reader=${uint32ToHex(
`sending ${changes.length} change(s) (${msg.size} bytes), reader=${this.readerName(
readerEntityId,
)}, writer=${uint32ToHex(writerEntityId)}`,
)}, writer=${this.writerName(writerEntityId)}`,
);
// Send this message as a UDP packet
await sendMessageToUdp(msg, srcSocket, locators);

@@ -454,3 +468,3 @@ }

void this.sendChanges(writer);
void this.sendMetatrafficChanges(writer);

@@ -503,3 +517,3 @@ return readerEntityId;

void this.sendChanges(writer);
void this.sendMetatrafficChanges(writer);

@@ -543,3 +557,3 @@ return true;

await this.sendChanges(writer);
await this.sendMetatrafficChanges(writer);
}

@@ -601,3 +615,3 @@

this._log?.debug?.(`unadvertising participant ${guidPrefix}`);
await this.sendChanges(writer);
await this.sendMetatrafficChanges(writer);
}

@@ -634,2 +648,7 @@

// If there are no sequence numbers to acknowledge, do not send an ACKNACK.
// Doing so will enter an infinite loop with FastRTPS
if (sequenceNumSet.base === 0n) {
return;
}
// If the final flag is set and we have no missing sequence numbers, do not send an ACKNACK

@@ -739,2 +758,17 @@ if (final && sequenceNumSet.empty()) {

private readerName(readerEntityId: EntityId): string {
const name =
this._subscriptions.get(readerEntityId)?.topicName ??
EntityIdBuiltin[readerEntityId] ??
EntityKind[readerEntityId & 0xff] ??
"(unknown)";
return `${name} [${uint32ToHex(readerEntityId)}]`;
}
private writerName(writerEntityId: EntityId): string {
const name =
EntityIdBuiltin[writerEntityId] ?? EntityKind[writerEntityId & 0xff] ?? "(unknown)";
return `${name} [${uint32ToHex(writerEntityId)}]`;
}
private handleError = (err: Error): void => {

@@ -802,7 +836,9 @@ if (this._running) {

this._log?.debug?.(
` [SUBMSG] HEARTBEAT reader=${uint32ToHex(heartbeat.readerEntityId)} writer=${uint32ToHex(
heartbeat.writerEntityId,
)} ${heartbeat.firstAvailableSeqNumber},${heartbeat.lastSeqNumber} (count=${
heartbeat.count
}, liveliness=${heartbeat.liveliness}, final=${heartbeat.final})`,
` [SUBMSG] HEARTBEAT reader=${this.readerName(
heartbeat.readerEntityId,
)} writer=${this.writerName(heartbeat.writerEntityId)} seq=${
heartbeat.firstAvailableSeqNumber
},${heartbeat.lastSeqNumber} (count=${heartbeat.count}, liveliness=${
heartbeat.liveliness
}, final=${heartbeat.final})`,
);

@@ -859,3 +895,3 @@

this._log?.debug?.(
` [SUBMSG] GAP reader=${uint32ToHex(readerEntityId)} writer=${uint32ToHex(
` [SUBMSG] GAP reader=${this.readerName(readerEntityId)} writer=${this.writerName(
writerEntityId,

@@ -890,5 +926,5 @@ )} gapStart=${gapStart}, gapEnd=${gapEnd}, list=${gapList.toString()}`,

this._log?.debug?.(
` [SUBMSG] ACKNACK reader=${uint32ToHex(ackNack.readerEntityId)} writer=${uint32ToHex(
ackNack.writerEntityId,
)} ${ackNack.readerSNState.toString()}`,
` [SUBMSG] ACKNACK reader=${this.readerName(
ackNack.readerEntityId,
)} writer=${this.writerName(ackNack.writerEntityId)} ${ackNack.readerSNState.toString()}`,
);

@@ -921,3 +957,7 @@

void this.sendChangesTo(readerView, writer, participant.attributes.defaultUnicastLocatorList);
void this.sendChangesTo(
readerView,
writer,
participant.attributes.metatrafficUnicastLocatorList,
);
};

@@ -951,3 +991,3 @@

this._log?.debug?.(
` [SUBMSG] DATA reader=${uint32ToHex(readerEntityId)} writer=${uint32ToHex(
` [SUBMSG] DATA reader=${this.readerName(readerEntityId)} writer=${this.writerName(
writerEntityId,

@@ -1153,3 +1193,7 @@ )} ${data.length} bytes (seq ${sequenceNumber}) from ${writerGuid}, ${

for (const reader of readers) {
void this.sendChangesTo(reader, writer, participant.attributes.defaultUnicastLocatorList);
void this.sendChangesTo(
reader,
writer,
participant.attributes.metatrafficUnicastLocatorList,
);
}

@@ -1156,0 +1200,0 @@ }

@@ -41,3 +41,3 @@ import { ParticipantAttributes } from "../ParticipantAttributes";

log?.info?.(
`Creating reader ${readerGuid} -> ${writerView.guid()} for ${subscription.topicName}`,
`creating reader ${readerGuid} -> ${writerView.guid()} for ${subscription.topicName}`,
);

@@ -44,0 +44,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc