class SCTPAssociation

SCTP Association. More...

Full nameCoral::SCTPAssociation
Definition#include <sctpassociation.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Protected Methods


Detailed Description

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:
addressArrayReference 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:
addressArrayReference 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:
bufferBuffer to store data to.
bufferSizeSize of data buffer; this will be overwritten with actual size of data content.
flagsFlags; this will be overwritten with actual reception flags.
streamIDVariable to store stream ID to.
protoIDVariable 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:
bufferBuffer to store data to.
bufferSizeSize of data buffer; this will be overwritten with actual size of data content.
flagsFlags; this will be overwritten with actual reception flags.
streamIDVariable to store stream ID to.
protoIDVariable to store protocol ID to.
addressArrayReference 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.
statusVariable 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:
bufferData to be sent.
lengthLength of data to be sent.
flagsFlags.
streamIDStream ID.
protoIDProtocol 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:
notificationFlagsNotification flags.

bool  getAssociationParameters (SCTP_Association_Status& associationParameters)

getAssociationParameters

Get association parameters.

Parameters:
associationParametersReference to store association parameters.

Returns: true, if successful; false otherwise.

bool  setAssociationParameters (const SCTP_Association_Status& associationParameters)

setAssociationParameters

Set association parameters.

Parameters:
associationParametersAssociation parameters.

Returns: true, if successful; false otherwise.

bool  getPathParameters (const int pathIndex, SCTP_PathStatus& pathParameters)

getPathParameters

Get path parameters.

Parameters:
pathIndexPath index (-1 for primary).
pathParametersReference to store path parameters.

Returns: true, if successful; false otherwise.

bool  setPathParameters (const int pathIndex, const SCTP_PathStatus& pathParameters)

setPathParameters

Set path parameters.

Parameters:
pathIndexPath index (-1 for primary).
pathParametersPath 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:
primaryPrimary address.

Returns: true for success; false otherwise.

bool  setPeerPrimary (const SocketAddress& primary)

setPeerPrimary

Set peer primary address of given association.

Parameters:
primaryPeer primary address.

Returns: true for success; false otherwise.

bool  addAddress (const SocketAddress& addAddress)

addAddress

Add address to given association.

Parameters:
addAddressAddress to be added.

Returns: true for success; false otherwise.

bool  deleteAddress (const SocketAddress& delAddress)

deleteAddress

Delete address from given association.

Parameters:
delAddressAddress to be deleted.

Returns: true for success; false otherwise.

ssize_t  getSendBuffer ()

getSendBuffer

Get send buffer size.

Parameters:
Sendbuffer size (-1 in case of error).

bool  setSendBuffer (const size_t size)

setSendBuffer

Set send buffer size.

Parameters:
sizeSend buffer size.

ssize_t  getReceiveBuffer ()

getReceiveBuffer

Get receive buffer size.

Parameters:
Receivebuffer size (-1 in case of error).

bool  setReceiveBuffer (const size_t size)

setReceiveBuffer

Set receive buffer size.

Parameters:
sizeReceive buffer size.

int  getTrafficClass (const int streamID = 0)

getTrafficClass

Get traffic class.

Parameters:
streamIDStream 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:
trafficClassTraffic class.
streamIDStream 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:
typeUpdate condition type.

Returns: Update condition.

 SCTPAssociation (SCTPSocket* socket, const unsigned int associationID, const unsigned int notificationFlags)

SCTPAssociation

[protected]