ObjFW
Loading...
Searching...
No Matches
OFSCTPSocket.h File Reference

Go to the source code of this file.

Classes

protocol  <OFSCTPSocketDelegate>
 
class  OFSCTPSocket
 A class which provides methods to create and use SCTP sockets in one-to-one mode. More...
 

Typedefs

typedef OFConstantStringOFSCTPMessageInfoKey
 A key for the SCTP message info.
 
typedef OFDictionaryOFSCTPMessageInfo
 A dictionary mapping keys of type OFSCTPMessageInfoKey to their values.
 
typedef void(^ OFSCTPSocketConnectedHandler) (OFSCTPSocket *socket, OFString *host, uint16_t port, id exception)
 A handler which is called when the socket connected.
 
typedef bool(^ OFSCTPSocketMessageReceivedHandler) (OFSCTPSocket *socket, void *buffer, size_t length, OFSCTPMessageInfo info, id exception)
 A handler which is called when a message has been received.
 
typedef OFData *(^ OFSCTPSocketDataSentHandler) (OFSCTPSocket *socket, OFData *data, OFSCTPMessageInfo info, id exception)
 A handler which is called when a message has been sent.
 

Variables

const OFSCTPMessageInfoKey OFSCTPStreamID
 The SCTP stream ID for which the message was send / received.
 
const OFSCTPMessageInfoKey OFSCTPPPID
 The Payload Protocol Identifier for the message.
 
const OFSCTPMessageInfoKey OFSCTPUnordered
 Whether the message is send / received out of order.
 

Typedef Documentation

◆ OFSCTPMessageInfoKey

A key for the SCTP message info.

Possible values are:

◆ OFSCTPSocketConnectedHandler

typedef void(^ OFSCTPSocketConnectedHandler) (OFSCTPSocket *socket, OFString *host, uint16_t port, id exception)

A handler which is called when the socket connected.

Parameters
socketThe socket which connected
hostThe host connected to
portThe port on the host connected to
exceptionAn exception which occurred while connecting the socket or nil on success

◆ OFSCTPSocketDataSentHandler

typedef OFData *(^ OFSCTPSocketDataSentHandler) (OFSCTPSocket *socket, OFData *data, OFSCTPMessageInfo info, id exception)

A handler which is called when a message has been sent.

Parameters
socketThe SCTP socket which sent a message
dataThe data which was sent
infoInformation about the message, see OFSCTPMessageInfo
exceptionAn exception which occurred while reading or nil on success
Returns
The data to repeat the send with or nil if it should not repeat

◆ OFSCTPSocketMessageReceivedHandler

typedef bool(^ OFSCTPSocketMessageReceivedHandler) (OFSCTPSocket *socket, void *buffer, size_t length, OFSCTPMessageInfo info, id exception)

A handler which is called when a message has been received.

Parameters
socketThe SCTP socket which received a message
bufferThe buffer the message has been written to
lengthThe length of the message
infoInformation about the message, see OFSCTPMessageInfo
exceptionAn exception which occurred while receiving or nil on success
Returns
A bool whether the same handler should be used for the next receive

Variable Documentation

◆ OFSCTPPPID

const OFSCTPMessageInfoKey OFSCTPPPID
extern

The Payload Protocol Identifier for the message.

This is an uint32_t wrapped in an OFNumber.

◆ OFSCTPStreamID

const OFSCTPMessageInfoKey OFSCTPStreamID
extern

The SCTP stream ID for which the message was send / received.

This is an uint16_t wrapped in an OFNumber.

◆ OFSCTPUnordered

const OFSCTPMessageInfoKey OFSCTPUnordered
extern

Whether the message is send / received out of order.

Possible values are an OFNumber with either true or false.