|
|
This class manages a SCTP socket (SCTP instance).
SCTPSocket (const bool hasGlobalQueue = false,
const bool sctpWait = true)
| SCTPSocket |
Constructor.
Parameters:
hasGlobalQueue | true to use a global queue for all associations; false otherwise (default). |
sctpWait | true to wait for success of sctp_shutdown() (default); false otherwise. |
~SCTPSocket ()
| ~SCTPSocket |
Destructor.
unsigned short getID ()
| getID |
[const]
Get internal instance ID.
Returns: Instance ID.
int bind (const unsigned short localPort,
const unsigned short noOfInStreams,
const unsigned short noOfOutStreams,
const SocketAddress** localAddressList)
| bind |
Bind socket to local port and address(es).
Parameters:
localPort | Local port. |
noOfInStreams | Number of incoming streams. |
noOfOutStreams | Number of outgoing streams. |
localAddressList | NULL-terminated array of local addresses. |
void unbind ()
| unbind |
Release socket binding.
See also: bind
SCTPAssociation* associate (const unsigned short noOfOutStreams,
const SocketAddress& destinationAddress,
const bool wait = true)
| associate |
Establish new association.
Parameters:
noOfOutStreams | Number of outgoing streams. |
destinationAddress | Destination address. |
wait | true to wait for establishment (default); false otherwise. |
Returns: Association or NULL in case of failure.
void listen (const unsigned int backlog)
| listen |
Set socket to listen mode: accept new incoming assocations.
Parameters:
backlog | Maximum number of incoming connections to accept simultaneously. |
SCTPAssociation* accept (SocketAddress*** addressArray = NULL,
const bool wait = true)
| accept |
Wait for incoming association.
Parameters:
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. |
wait | true to wait for new association (default); false otherwise. |
Returns: New association or NULL in case of failure.
See also: SocketAddress#deleteAddressList
bool getLocalAddresses (SocketAddress**& addressArray)
| getLocalAddresses |
Get socket's 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
SCTPAssociation* getAssociationForAssociationID (const unsigned int assocID,
const bool activeOnly = true)
| getAssociationForAssociationID |
[protected]
int getErrorCode (const unsigned int assocID)
| getErrorCode |
[protected]
int internalReceive (ChunkArrivalQueue& queue,
char* dataBuffer,
size_t& dataBufferSize,
char* controlBuffer,
size_t& controlBufferSize,
int& flags,
unsigned int& assocID,
unsigned short& streamID,
unsigned int& protoID,
AssociationStatus& status)
| internalReceive |
[protected]
int internalSend (const char* buffer,
const size_t length,
const int flags,
const unsigned int assocID,
const unsigned short streamID,
const unsigned int protoID)
| internalSend |
[protected]
IncomingConnection (struct) | IncomingConnection |
[protected]
IncomingConnection* ConnectionRequests | ConnectionRequests |
[protected]
ChunkArrivalQueue GlobalQueue | GlobalQueue |
[protected]
multimap<unsigned int, SCTPAssociation*> SCTPAssociationList | SCTPAssociationList |
[protected]
Condition EstablishCondition | EstablishCondition |
[protected]
unsigned short InstanceName | InstanceName |
[protected]
unsigned short LocalPort | LocalPort |
[protected]
unsigned short NoOfInStreams | NoOfInStreams |
[protected]
unsigned short NoOfOutStreams | NoOfOutStreams |
[protected]
unsigned int NoOfLocalAddresses | NoOfLocalAddresses |
[protected]
unsigned char LocalAddressList[SCTP_MAX_NUM_ADDRESSES][SCTP_MAX_IP_LEN] | LocalAddressList[SCTP_MAX_NUM_ADDRESSES][SCTP_MAX_IP_LEN] |
[protected]
bool HasGlobalQueue | HasGlobalQueue |
[protected]
bool ServerMode | ServerMode |
[protected]
bool SCTPWait | SCTPWait |
[protected]