Xirsys.Sockets.Transport.SCTP (xturn_sockets v2.2.0)

View Source

SCTP transport (:gen_sctp) when the OTP driver is available.

accept/2 returns {:error, :sctp_not_supported}: associations arrive as messages on the listen socket and cannot be driven by Acceptor's accept loop.

iex> Xirsys.Sockets.Transport.SCTP.framing()
:datagram
iex> Xirsys.Sockets.Transport.SCTP.handle_message({:sctp, :sock, {127, 0, 0, 1}, 9, [], "hi"}, :sock)
{:data, "hi", {{127, 0, 0, 1}, 9}}
iex> Xirsys.Sockets.Transport.SCTP.handle_message({:sctp_closed, :sock}, :sock)
{:closed, :normal}

Summary

Functions

SCTP has no accept/2; associations arrive as messages on the listen socket.

Functions

accept(listen_sock, timeout)

SCTP has no accept/2; associations arrive as messages on the listen socket.

Always returns {:error, :sctp_not_supported} so callers use a custom association handler instead of Acceptor's accept loop.

Parameters

  • _listen_sock - SCTP listen socket (unused)
  • _timeout - accept timeout (unused)