1#ifndef NET_SCTPSocket_h__
2#define NET_SCTPSocket_h__
7#include <netinet/sctp.h>
34 SCTPSocket( uint16_t numOutStreams = 10, uint16_t maxInStreams = 65535, uint16_t maxAttempts = 4,
35 uint16_t maxInitTimeout = 0 );
37 int bind(
const std::vector<std::string>& localAddresses,
unsigned short localPort = 0);
39 int connect(
const std::vector<std::string>& foreignAddresses,
unsigned short foreignPort = 0);
50 IOResult send(
const void* data,
size_t length, uint16_t stream,
unsigned ttl = 0,
unsigned context = 0,
unsigned ppid = 0,
53 IOResult sendUnordered(
const void* data,
size_t length, uint16_t stream,
unsigned ttl = 0,
unsigned context = 0,
68 std::optional<SCTPSocket>
accept()
const;
72 void setInitValues( uint16_t ostr, uint16_t istr, uint16_t att, uint16_t time);
InternetSocket(AddressFamily family, int type, int protocol)
allows a subclass to create new socket
std::optional< SCTPSocket > timedAccept(int timeout) const
std::optional< SCTPSocket > accept() const
InternetSocket(AddressFamily family, int type, int protocol)
allows a subclass to create new socket
IOResult send(const void *data, size_t length, uint16_t stream, unsigned ttl=0, unsigned context=0, unsigned ppid=0, abortFlag abort=KEEPALIVE, switchAddressFlag switchAddr=KEEP_PRIMARY)
IOResult sendUnordered(const void *data, size_t length, uint16_t stream, unsigned ttl=0, unsigned context=0, unsigned ppid=0, abortFlag abort=KEEPALIVE, switchAddressFlag switchAddr=KEEP_PRIMARY)
void setInitValues(uint16_t ostr, uint16_t istr, uint16_t att, uint16_t time)
std::string primaryAddress() const
IOResult timedReceive(void *data, size_t maxLen, uint16_t &stream, int timeout)
SCTPSocket(uint16_t numOutStreams=10, uint16_t maxInStreams=65535, uint16_t maxAttempts=4, uint16_t maxInitTimeout=0)
IOResult timedReceive(void *data, size_t maxLen, uint16_t &stream, receiveFlag &flag, int timeout)
IOResult receive(void *data, size_t maxLen, uint16_t &stream, receiveFlag &flag)
unsigned outStreams() const
int bind(const std::vector< std::string > &localAddresses, unsigned short localPort=0)
int connect(const std::vector< std::string > &foreignAddresses, unsigned short foreignPort=0)
unsigned fragmentationPoint() const
IOResult receive(void *data, size_t maxLen, uint16_t &stream)
unsigned inStreams() const
IOResult send(const void *buffer, size_t len)
send data through a connected socket
void listen(int backlog=128)
listen for incoming connections
ConnectResult finishConnect(int timeout=0)
check if a previously started connected attempt is finished