@ndn/endpoint
Advanced tools
Comparing version 0.0.20240630 to 0.0.20250122
@@ -16,3 +16,3 @@ import type { Forwarder } from "@ndn/fw"; | ||
/** | ||
* AbortSignal that allows cancelation via AbortController. | ||
* AbortSignal that allows cancellation via AbortController. | ||
* | ||
@@ -19,0 +19,0 @@ * @remarks |
@@ -15,2 +15,4 @@ import { CancelInterest, Forwarder, FwPacket } from "@ndn/fw"; | ||
Interest.makeModifyFunc(modifyInterest)(interest); | ||
let txTime = 0; | ||
let rtt; | ||
let nRetx = -1; | ||
@@ -32,2 +34,3 @@ const retxGen = makeRetxGenerator(retx)(interest.lifetime)[Symbol.iterator](); | ||
rx.push(FwPacket.create(interest)); | ||
txTime = performance.now(); | ||
++nRetx; | ||
@@ -45,2 +48,3 @@ }; | ||
if (pkt.l3 instanceof Data) { | ||
rtt = performance.now() - txTime; | ||
try { | ||
@@ -74,2 +78,3 @@ await verifier?.verify(pkt.l3); | ||
nRetx: { get() { return nRetx; } }, | ||
rtt: { get() { return rtt; } }, | ||
}); | ||
@@ -76,0 +81,0 @@ } |
@@ -15,2 +15,4 @@ import { CancelInterest, Forwarder, FwPacket } from "@ndn/fw"; | ||
Interest.makeModifyFunc(modifyInterest)(interest); | ||
let txTime = 0; | ||
let rtt; | ||
let nRetx = -1; | ||
@@ -32,2 +34,3 @@ const retxGen = makeRetxGenerator(retx)(interest.lifetime)[Symbol.iterator](); | ||
rx.push(FwPacket.create(interest)); | ||
txTime = performance.now(); | ||
++nRetx; | ||
@@ -45,2 +48,3 @@ }; | ||
if (pkt.l3 instanceof Data) { | ||
rtt = performance.now() - txTime; | ||
try { | ||
@@ -74,2 +78,3 @@ await verifier?.verify(pkt.l3); | ||
nRetx: { get() { return nRetx; } }, | ||
rtt: { get() { return rtt; } }, | ||
}); | ||
@@ -76,0 +81,0 @@ } |
@@ -36,4 +36,18 @@ import { Data, Interest, type NameLike, type Verifier } from "@ndn/packet"; | ||
export interface ConsumerContext extends Promise<Data> { | ||
/** Interest packet, after any modifications. */ | ||
readonly interest: Interest; | ||
/** | ||
* Number of retransmissions sent so far. | ||
* | ||
* @remarks | ||
* The initial Interest does not count as a retransmission. | ||
*/ | ||
readonly nRetx: number; | ||
/** | ||
* Duration (milliseconds) between last Interest transmission and Data arrival. | ||
* | ||
* @remarks | ||
* This is a valid RTT measurement if {@link nRetx} is zero. | ||
*/ | ||
readonly rtt: number | undefined; | ||
} | ||
@@ -40,0 +54,0 @@ /** |
@@ -51,3 +51,3 @@ import { type FwFace } from "@ndn/fw"; | ||
* This option does not apply to Data packets manually inserted into `.dataBuffer`. To auto-sign | ||
* those packet, specify {@link DataStoreBuffer.Options.dataSigner} in addition. | ||
* those packets, specify {@link DataStoreBuffer.Options.dataSigner} in addition. | ||
*/ | ||
@@ -54,0 +54,0 @@ dataSigner?: Signer; |
{ | ||
"name": "@ndn/endpoint", | ||
"version": "0.0.20240630", | ||
"version": "0.0.20250122", | ||
"description": "NDNts: Client Endpoint", | ||
@@ -25,9 +25,9 @@ "keywords": [ | ||
"dependencies": { | ||
"@ndn/fw": "0.0.20240630", | ||
"@ndn/packet": "0.0.20240630", | ||
"@ndn/util": "0.0.20240630", | ||
"@ndn/fw": "0.0.20250122", | ||
"@ndn/packet": "0.0.20250122", | ||
"@ndn/util": "0.0.20250122", | ||
"streaming-iterables": "^8.0.1", | ||
"tslib": "^2.6.3" | ||
"tslib": "^2.8.1" | ||
}, | ||
"types": "lib/mod.d.ts" | ||
} |
Sorry, the diff of this file is not supported yet
35679
832
+ Added@ndn/fw@0.0.20250122(transitive)
+ Added@ndn/packet@0.0.20250122(transitive)
+ Added@ndn/tlv@0.0.20250122(transitive)
+ Added@ndn/util@0.0.20250122(transitive)
+ Added@ungap/with-resolvers@0.1.0(transitive)
- Removed@ndn/fw@0.0.20240630(transitive)
- Removed@ndn/packet@0.0.20240630(transitive)
- Removed@ndn/tlv@0.0.20240630(transitive)
- Removed@ndn/util@0.0.20240630(transitive)
- Removedhirestime@7.0.4(transitive)
- Removedmnemonist@0.39.8(transitive)
Updated@ndn/fw@0.0.20250122
Updated@ndn/packet@0.0.20250122
Updated@ndn/util@0.0.20250122
Updatedtslib@^2.8.1