Options
All
  • Public
  • Public/Protected
  • All
Menu

@ndn/endpoint

This package is part of NDNts, Named Data Networking libraries for the modern web.

This package implements Endpoint type, which is the basic abstraction through which an application can communicate with the NDN network.

An endpoint is similar to a "client face" in other NDN libraries, with the enhancement that it handles these details automatically:

  • Outgoing packets are signed and incoming packets are verified, if trust schema is provided.
  • Outgoing Interests are retransmitted periodically, if retransmission policy is specified.
  • Outgoing Data buffer, if enabled, allows the producer to reply to one Interest with multiple Data (e.g. segments), or push generated Data without receiving an Interest.
    Data will be sent automatically upon Interest arrival.
  • The underlying transport is reconnected upon failure, if transport failure policy is specified (implemented in @ndn/l3face package).
  • Prefix registrations are refreshed periodically or upon transport reconnection.

Index

References

ConsumerContext

Renames and re-exports Context

ConsumerOptions

Renames and re-exports Options

DataBuffer

Re-exports DataBuffer

DataStoreBuffer

Re-exports DataStoreBuffer

Endpoint

Re-exports Endpoint

Options

Re-exports Options

Producer

Re-exports Producer

ProducerHandler

Renames and re-exports Handler

ProducerOptions

Renames and re-exports Options

RetxOptions

Re-exports RetxOptions

RetxPolicy

Re-exports RetxPolicy

Type aliases

Context

Context: PCancelable<Data> & { interest: Interest; nRetx: number }

Progress of Data retrieval.

This is a Promise that resolves with the retrieved Data, and rejects upon timeout. Calling .cancel() cancels Data retrieval and rejects the Promise.

Handler

Handler: (interest: Interest, producer: Producer) => Promise<Data | false>

Producer handler function.

The handler can return a Data to respond to the Interest, or return 'false' to cause a timeout.

If Options.dataBuffer is provided, the handler can access the DataBuffer via producer.dataBuffer . The handler can return a Data to respond to the Interest, which is also inserted to the DataBuffer unless Options.autoBuffer is set to false. If the handler returns 'false', the Interest is used to query the DataBuffer, and any matching Data may be sent.

Type declaration

    • (interest: Interest, producer: Producer): Promise<Data | false>
    • Parameters

      Returns Promise<Data | false>

ModifyInterest

ModifyInterestFunc

ModifyInterestFunc: (interest: Interest) => void

Type declaration

    • (interest: Interest): void
    • Parameters

      • interest: Interest

      Returns void

RetxGenerator

RetxGenerator: (interestLifetime: number) => Iterable<number>

A function to generate retx intervals.

Type declaration

    • (interestLifetime: number): Iterable<number>
    • Parameters

      • interestLifetime: number

      Returns Iterable<number>

RetxPolicy

RetxPolicy: RetxOptions | RetxGenerator | number

Interest retransmission policy.

A number is interpreted as the limit. Set 0 to disable retransmissions.

Functions

makeModifyInterest

makeRetxGenerator

signUnsignedData

  • signUnsignedData(data: Data, dataSigner: Signer | undefined): Promise<void>

Legend

  • Namespace
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Class
  • Class with type parameter
  • Enumeration

Generated using TypeDoc