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
|
||||||||||||||||||||||||||||||||
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