On this page

C

DTLSEndpoint

History

Manages a UDP socket and multiplexes DTLS sessions.

Returns:Object
{ address, family, port }

The local address the endpoint is bound to.

P

endpoint.stats

History

The statistics collected for this endpoint. Read only. The stats object is live and updated as data flows through the endpoint.

Attributes

When true, the endpoint rejects new incoming connections. Can be set to implement backpressure.

endpoint.close(): Promise
Returns:Promise
Resolves when the endpoint is fully closed.

Gracefully closes the endpoint. All active sessions are closed with close_notify alerts before the UDP socket is released.

endpoint.destroy(error?): void

Immediately destroys the endpoint without sending close_notify alerts.

Attributes
True once the endpoint has been destroyed.
Attributes
Resolves when the endpoint has fully closed.
endpoint[Symbol.asyncDispose](): void

Equivalent to calling endpoint.close().

P

endpoint.onerror

History
Attributes

Set to receive errors that belong to the endpoint rather than to any one session. Neither closes the endpoint. They are:

  • A failure reported by the UDP socket while receiving.
  • An exception thrown by the server's psk callback for a DTLS 1.3 client whose address has not yet been validated. The callback is first asked about the client's opening ClientHello, before there is a session to report to, so the exception is passed here, as thrown, and the client is refused. A peer that has not proven its address can cause this once for each ClientHello it sends, so the handler should be cheap.

Without a handler these errors are discarded.