-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
127 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { connectToNetwork } from "@ndn/autoconfig"; | ||
import { Endpoint } from "@ndn/endpoint"; | ||
import { Interest } from "@ndn/packet"; | ||
|
||
// Connect the default forwarder instance to the closest NDN testbed node using the FCH secvice | ||
await connectToNetwork({ | ||
fallback: ["titan.cs.memphis.edu"], // optional fallback list | ||
connectTimeout: 3000, // optional connection timeout | ||
}); | ||
|
||
// Create an endpoint using the default forwarder instance | ||
const endpoint = new Endpoint(); | ||
|
||
// Send an Interest to a ping server on the testbed | ||
const interest = new Interest(`/ndn/edu/memphis/ping/1234`); | ||
const data = await endpoint.consume(interest); // wait for echo |