|
|
This class manages a SCTP assocation. Note: The constructor is protected, a SCTP assocation can be created from an SCTP socket using associate() or accept().
See also: SCTPSocket, SCTPSocket#associate, SCTPSocket#accept
~SCTPAssociation ()
| ~SCTPAssociation |
Destructor.
inline unsigned int getID ()
| getID |
[const]
Get internal association ID.
Returns: Association ID.
bool getLocalAddresses (SocketAddress**& addressArray)
| getLocalAddresses |
Get local addresses.
Parameters:
addressArray | Reference to store NULL-terminated array of local addresses. The addresses are allocated automatically and have to be freed using deleteAddressList(). |
Returns: true, if addressEntries are sufficient; false otherwise.
See also: SocketAddress#deleteAddressList
bool getRemoteAddresses (SocketAddress**& addressArray)
| getRemoteAddresses |
Get remote addresses.
Parameters:
addressArray | Reference to store NULL-terminated array of local addresses. The addresses are allocated automatically and have to be freed using deleteAddressList(). |
Returns: true, if addressEntries are sufficient; false otherwise.
See also: SocketAddress#deleteAddressList
int receive (char* buffer,
size_t& bufferSize,
int& flags,
unsigned short& streamID,
unsigned int& protoID)
| receive |
Receive data.
Parameters:
buffer | Buffer to store data to. |
bufferSize | Size of data buffer; this will be overwritten with actual size of data 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. |
Returns: error code (0 for success).
int receiveFrom (char* buffer,
size_t& bufferSize,
int& flags,
unsigned short& streamID,
unsigned int& protoID,
SocketAddress*** addressArray,
SCTPNotification& notification)
| receiveFrom |
Receive data.
Parameters:
buffer | Buffer to store data to. |
bufferSize | Size of data buffer; this will be overwritten with actual size of data 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. |
status | Variable to store SCTPNotification data to. |
Returns: error code (0 for success).
int send (const char* buffer,
const size_t length,
const int flags,
const unsigned short streamID,
const unsigned int protoID)
| send |
Send data.
Parameters:
buffer | Data to be sent. |
length | Length of data to be sent. |
flags | Flags. |
streamID | Stream ID. |
protoID | Protocol ID. |
Returns: error code (0 for success).
void shutdown ()
| shutdown |
Shutdown.
void abort ()
| abort |
Abort.
inline unsigned int getNotificationFlags ()
| getNotificationFlags |
[const]
Get notification flags.
Returns: Notification flags.
inline void setNotificationFlags (const unsigned int notificationFlags)
| setNotificationFlags |
Get notification flags.
Parameters:
notificationFlags | Notification flags. |
bool getAssociationParameters (SCTP_Association_Status& associationParameters)
| getAssociationParameters |
Get association parameters.
Parameters:
associationParameters | Reference to store association parameters. |
Returns: true, if successful; false otherwise.
bool setAssociationParameters (const SCTP_Association_Status& associationParameters)
| setAssociationParameters |
Set association parameters.
Parameters:
associationParameters | Association parameters. |
Returns: true, if successful; false otherwise.
bool getPathParameters (const int pathIndex,
SCTP_PathStatus& pathParameters)
| getPathParameters |
Get path parameters.
Parameters:
pathIndex | Path index (-1 for primary). |
pathParameters | Reference to store path parameters. |
Returns: true, if successful; false otherwise.
bool setPathParameters (const int pathIndex,
const SCTP_PathStatus& pathParameters)
| setPathParameters |
Set path parameters.
Parameters:
pathIndex | Path index (-1 for primary). |
pathParameters | Path parameters. |
Returns: true, if successful; false otherwise.
SocketAddress* getPrimaryAddress ()
| getPrimaryAddress |
Get primary address.
Returns: Primary address. This address has to be deleted after usage.
bool setPrimary (const SocketAddress& primary)
| setPrimary |
Set primary address of given association.
Parameters:
primary | Primary address. |
Returns: true for success; false otherwise.
bool setPeerPrimary (const SocketAddress& primary)
| setPeerPrimary |
Set peer primary address of given association.
Parameters:
primary | Peer primary address. |
Returns: true for success; false otherwise.
bool addAddress (const SocketAddress& addAddress)
| addAddress |
Add address to given association.
Parameters:
addAddress | Address to be added. |
Returns: true for success; false otherwise.
bool deleteAddress (const SocketAddress& delAddress)
| deleteAddress |
Delete address from given association.
Parameters:
delAddress | Address to be deleted. |
Returns: true for success; false otherwise.
ssize_t getSendBuffer ()
| getSendBuffer |
Get send buffer size.
Parameters:
Send | buffer size (-1 in case of error). |
bool setSendBuffer (const size_t size)
| setSendBuffer |
Set send buffer size.
Parameters:
size | Send buffer size. |
ssize_t getReceiveBuffer ()
| getReceiveBuffer |
Get receive buffer size.
Parameters:
Receive | buffer size (-1 in case of error). |
bool setReceiveBuffer (const size_t size)
| setReceiveBuffer |
Set receive buffer size.
Parameters:
size | Receive buffer size. |
int getTrafficClass (const int streamID = 0)
| getTrafficClass |
Get traffic class.
Parameters:
streamID | Stream ID (default: 0). |
Returns: Traffic class (-1 in case of error).
bool setTrafficClass (const card8 trafficClass,
const int streamID = -1)
| setTrafficClass |
Set traffic class.
Parameters:
trafficClass | Traffic class. |
streamID | Stream ID (-1 for all streams, default). |
enum UpdateConditionTypes { UCT_Read = 0, UCT_Write = 1, UCT_Except = 2 } | UpdateConditionTypes |
Update condition types.
inline Condition* getUpdateCondition (const cardinal type)
| getUpdateCondition |
Get pointer to update condition.
Parameters:
type | Update condition type. |
Returns: Update condition.
SCTPAssociation (SCTPSocket* socket,
const unsigned int associationID,
const unsigned int notificationFlags)
| SCTPAssociation |
[protected]