|
|
This class manages a connectionless (UDP-style) SCTP socket. Internally, this class automatically establishs or accepts new SCTP associations.
SCTPConnectionlessSocket (const bool sctpWait = false)
| SCTPConnectionlessSocket |
Constructor.
Parameters:
sctpWait | true to wait for success of sctp_shutdown() (default); false otherwise. |
~SCTPConnectionlessSocket ()
| ~SCTPConnectionlessSocket |
Destructor.
int receiveFrom (char* dataBuffer,
size_t& dataBufferSize,
char* controlBuffer,
size_t& controlBufferSize,
int& flags,
unsigned short& streamID,
unsigned int& protoID,
SocketAddress*** addressArray,
AssociationStatus& status)
| receiveFrom |
Receive data.
Parameters:
dataBuffer | Buffer to store data to. |
dataBufferSize | Size of data buffer; this will be overwritten with actual size of data content. |
controlBuffer | Buffer to store control data to. |
controlBufferSize | Size of control buffer; this will be overwritten with actual size of control content. |
flags | Flags; this will be overwritten with actual reception flags. |
streamID | Variable to store stream ID to. |
protoID | Variable to store protocol ID to. |
addressArray | Reference to store NULL-terminated array of peer addresses. The addresses are allocated automatically and have to be freed using deleteAddressList(). Set NULL to skip creation of the address array. |
addressEntries | Number of addressEntries; this will be overwritten by the sender's number of peer addresses. |
status | Variable to store AssocationStatus data to. |
Returns: error code (0 for success).
See also: SocketAddress#deleteAddressList
int sendTo (const char* buffer,
const size_t length,
const int flags,
const unsigned short streamID,
const unsigned int protoID,
const SocketAddress& destinationAddress)
| sendTo |
Send data.
Parameters:
buffer | Data to be sent. |
length | Length of data to be sent. |
flags | Flags. |
streamID | Stream ID. |
protoID | Protocol ID. |
destinationAddress | Destination address. |
Returns: error code (0 for success).