Skip to content

Interface: InterfaceListeningOptions ​

The options of an adapter listening on network interfaces instead of an address: the adapter listens on the interfaces whatever their addresses, again when they change and when an interface is unplugged and plugged back, through an implementation of IInterfaceListening of @lakutata/core (the package @lakutata/netif, installed apart, by default).

Properties ​

family? ​

optional family?: "IPv4" | "IPv6" | "both"

With interface: the families listened on, 'IPv4', 'IPv6' or 'both'.

Default ​

ts
'both'

interface? ​

optional interface?: NetworkInterfaceSelector | NetworkInterfaceSelector[]

The network interface to listen on instead of an address: its name ('eth1'; on Windows the name of the network connection), {mac: '52:54:00:12:34:56'} or {index: 3}; several of them in an array (then the port cannot be 0). It excludes host. The interface may not exist yet: the adapter starts, and listens on it once it can.


interfaceListening? ​

optional interfaceListening?: IInterfaceListening

With interface: the implementation of the listening on interfaces.

Default ​

the one of @lakutata/netif, loaded when interface is given (an error tells how to install it when it is missing)


onError? ​

optional onError?: (error) => void | Promise<void>

With interface: the errors of the listening on the interfaces once the adapter started (the port taken when an interface is listened on again, the guarantee of strict lost), retried by the listeners. Without it they are written to the log of the application.

Parameters ​

error ​

unknown

Returns ​

void | Promise<void>


strict? ​

optional strict?: boolean

With interface: the adapter fails to start where the system cannot refuse the connections reaching the addresses of the interface through another interface, and stops listening while that guarantee is lost (see enforced of the listeners). false by default: the best the system allows.

Released under the MIT License.