Represents a DTLS association with a single remote peer.
session.send(data): number
Attributes
Send application data to the peer. The data is encrypted by DTLS before
being sent over UDP. Can only be called after the handshake completes
(session.opened has resolved).
session.close(): Promise
Returns:
PromiseResolves when the session is closed.
Initiates a graceful DTLS shutdown by sending a close_notify alert.
session.destroy(error?): void
Immediately destroys the session without sending close_notify.
Attributes
Resolves with
{ protocol } when the DTLS handshake completes.Attributes
Resolves when the session is fully closed.
Returns:
Object{ address, family, port }Returns:
stringThe negotiated DTLS protocol version
(e.g.,
'DTLSv1.2').Returns:
Object{ name, standardName, version }Type:
DTLSSession.StatsThe statistics collected for this session. Read only. The stats object is live and updated as data flows through the session.
session.exportKeyingMaterial(length, label, context?): Buffer
Attributes
Exports keying material from the DTLS session, as defined in RFC 5705. This is commonly used with DTLS-SRTP to derive encryption keys for media streams.