Dtls

Dtls

new Dtls(opts, adapter)

Source:

A transport for data that involves sending and receiving packets via Datagram Transport Layer Security. See RFC 6347: https://tools.ietf.org/html/rfc6347

Parameters:
Name Type Description
opts Object

General settings for the Dtls Transport

Properties
Name Type Attributes Description
protocol String

"udp4" or "udp6"

port Buffer

Port the underlying datagram socket shall be bound to. If not specified, the operating system is requested to assign a port at its discretion.

psk Buffer

The preshared key between this Transport and external clients or servers

maxNumRestartsOnError Buffer <optional>

Inclusive upper limit on the number of total "cycles" that the DTLS receiver will go through after terminating on an error. A cycle is one iteration of a termination followed by a reinitialization of the DTLS receiver.

allowedReceiverStartupTimeMsec Number <optional>

The duration (msec) to wait for the DTLS receiver to complete initialization.

handshakeTimeoutMinMsec Number <optional>

The duration (msec) to wait for the DTLS receiver to complete a handshake when clients are connecting.

socketSessionCloseTimeoutMsec Number <optional>

Time before marking a DTLS Session as having expired due to lack of communication.

adapter Adapter

Adapter instance for which this is a transport.

Extends

Methods

close() → {Promise}

Source:

Close the Dtls Server, if one was created.

Returns:
Type
Promise

commonNewSocketHandler(socket)

Source:

Provides the logic to add the new socket to the session tracker map and set up necessary handlers.

Parameters:
Name Type Description
socket DtlsSocket

init() → {Promise}

Source:

Setup the listener if one is configured

Returns:
Type
Promise

initializeReceiverErrorHandler()

Source:

Additional processing on Dtls Receiver/Server errors. Currently, it closes and reopens the DTLS Server upon each error event until the max allowable error count threshold is reached.

(private) received(data, rinfo)

Source:

Process incoming data

Parameters:
Name Type Description
data Buffer

The data buffer

rinfo Object

Info about the receiver

send(address, command) → {Promise}

Source:
Overrides:

Send a command to the specified address

Parameters:
Name Type Description
address Object

The address the command will be sent to

command Command

The command to send

Returns:
Type
Promise

(private) write(data, port, host) → {Promise}

Source:

Write data to the DTLS socket session

Parameters:
Name Type Description
data Buffer

The data buffer

port Number

The destination port

host String

The destination IP address

Returns:

Resolves after the data in the Buffer has been written to the DTLS socket session

Type
Promise