Requires libsctp of LKSCTP, also known as libsctp-dev debian package.
It has been tested to work with v1.0.19 and v1.0.20, but most likely also supports older versions and newer versions.
The library must set HAVE_SCTP_SENDV, which will be the case when struct sctp_prinfo
is around during compile time. Some debian versions ship libsctp-dev without this macro.
You can always compile libsctp yourself like so:
FROM debian:bullseye
RUN apt-get update && apt-get install -y build-essential autoconf automake libtool git
WORKDIR /root
RUN git clone https://github.com/sctp/lksctp-tools.git
WORKDIR /root/lksctp-tools
RUN git checkout v1.0.19
RUN ./bootstrap
RUN ./configure
RUN make -j $(nproc)
RUN make install
Refer to Node.js Net API.
Several existing differences explained below.
The Socket constructor is not available. Use lksctp.createServer()
or lksctp.connect()
- options [Object]
options:
allowHalfOpen- highWaterMark [number] (see Node's Net)
keepAlivekeepAliveInitialDelay- noDelay [boolean] optional flag to disable Nagle's algorithm
pauseOnConnect- MIS [number] maximum number of input streams
- OS [number] number of output streams
- sctp [Object] optional
- sack [Object] optional, socket option SCTP_DELAYED_SACK as defined in RFC, will be set for every connection
- delay [number]
sack_delay
of socket option - freq [number]
sack_freq
of socket option
- delay [number]
- sack [Object] optional, socket option SCTP_DELAYED_SACK as defined in RFC, will be set for every connection
- options [Object]
Only the options variant of Net is supported.
options:
- backlog [number] number of connections kernel will accept for us
exclusive- host [string] optional local IP address to bind to
- localAddresses [string[]] optional list of local address to bind to (host option is not allowed if this is passed)
ipv6Onlypath- port [number] optional local port to bind to
readableAllsignalwritableAll
Get locally bound addresses
- options [Object]
Only the options variant of Net is supported.
options:
- host [string] remote host IP adress to connect to
- remoteAddresses [string[]] remote host IP addresses to connect to (host option is not allowed if this is passed)
- port [number] remote port to connect to
- localPort [number] optional local port to bind to
- localAddress [string] optional local IP address to bind to
- localAddresses [string[]] optional list of local address to bind to (localAddress option is not allowed if this is passed)
- noDelay [boolean] optional flag to disable Nagle's algorithm
- MIS [number] maximum number of input streams
- OS [number] number of output streams
- sctp [Object] optional
- sack [Object] optional, socket option SCTP_DELAYED_SACK as defined in RFC
- delay [number]
sack_delay
of socket option - freq [number]
sack_freq
of socket option
- delay [number]
- sack [Object] optional, socket option SCTP_DELAYED_SACK as defined in RFC
See Node's Stream
- data [Buffer]
- data.ppid [number] optional payload protocol identifier
- data.sid [number] optional stream ID
Like Node's Net
Get a status object based on SCTP_STATUS
Like Node's Net This will cause a normal shutdown
Like Node's Net This will cause an ABORT via SO_LINGER if the stream has not been closed via end() yet.
Local family, "IPv4"
Locally bound port
Locally bound current primary address (may change during runtime)
List of currently locally bound addresses (may change during runtime, including primary address of localAddress)
Remote family, "IPv4"
Locally bound port
Remote current primary address (may change during runtime)
List of current remote addresses (may change during runtime, including primary address of localAddress)
- info - peer address information based on RFC, or undefined if unavailable
- data [Buffer]
- data.ppid [number] received payload protocol identifier
- data.sid [number] received stream ID
Raised when an address change is detected (examine duplex
.local* and duplex
.remote*)
A Notification has been received. Event parameter contains raw, parsed and interpreted event data.
Event that duplex
.peerInfoByAddress has been updated (not necessarily changed).