Abstract SCTP Socket.
More...
#include <yateclass.h>
List of all members.
Public Member Functions |
| | SctpSocket () |
| | SctpSocket (SOCKET fd) |
| virtual | ~SctpSocket () |
| virtual bool | bindx (ObjList &addresses)=0 |
| virtual bool | connectx (ObjList &addresses)=0 |
| virtual int | sendTo (void *buffer, int length, int stream, SocketAddr &addr, int flags)=0 |
| virtual Socket * | accept (SocketAddr &addr) |
| virtual int | sendMsg (const void *buf, int length, int stream, int &flags)=0 |
| virtual int | recvMsg (void *buf, int length, SocketAddr &addr, int &stream, int &flags)=0 |
| virtual bool | setStreams (int inbound, int outbound)=0 |
| virtual bool | subscribeEvents ()=0 |
| virtual bool | getStreams (int &inbound, int &outbound)=0 |
| virtual bool | setPayload (u_int32_t payload)=0 |
Detailed Description
Abstract SCTP Socket.
The SctpSocket interface provides access to SCTP specific functions
Constructor & Destructor Documentation
Constructor
- Parameters:
-
| fd | File descriptor of an existing handle |
Member Function Documentation
Accept an incoming connection
- Parameters:
-
| addr | The socket address of the incoming connection |
- Returns:
- A new SctpSocket if an incoming connection was detected
Reimplemented from Socket.
Bind this socket to multiple addresses
- Parameters:
-
- Returns:
- True if the socket bind succeded
Connect this socket to multiple addresses
- Parameters:
-
- Returns:
- True if the socket connect succeded
| virtual bool getStreams |
( |
int & |
inbound, |
|
|
int & |
outbound |
|
) |
| [pure virtual] |
Get the number of negotiated streams
- Parameters:
-
| inbound | Number of inbound streams |
| outbound | Number of outbound streams |
- Returns:
- True if operation has succeded
| virtual int recvMsg |
( |
void * |
buf, |
|
|
int |
length, |
|
|
SocketAddr & |
addr, |
|
|
int & |
stream, |
|
|
int & |
flags |
|
) |
| [pure virtual] |
Receive data from a connected socket
- Parameters:
-
| buf | The buffer where the data will be stored |
| length | The buffer length |
| addr | Gets the remote address from which the data was received |
| stream | Gets the stream number on which the data was read |
| flags | Flags, gets altered on return |
- Returns:
- The number of bytes read
| virtual int sendMsg |
( |
const void * |
buf, |
|
|
int |
length, |
|
|
int |
stream, |
|
|
int & |
flags |
|
) |
| [pure virtual] |
Send a buffer of data over a connected socket
- Parameters:
-
| buf | The data to send |
| length | Data length |
| stream | The stream number to send over |
| flags | Flags, gets altered on return |
- Returns:
- The number of bytes sent
| virtual int sendTo |
( |
void * |
buffer, |
|
|
int |
length, |
|
|
int |
stream, |
|
|
SocketAddr & |
addr, |
|
|
int |
flags |
|
) |
| [pure virtual] |
Send a message over a connected or unconnected socket
- Parameters:
-
| buffer | Buffer for data transfer |
| length | Length of the buffer |
| stream | The stream number |
| addr | Address to send the message to, if NULL will behave like send() |
| flags | Operating system specific bit flags that change the behaviour |
- Returns:
- Number of bytes transferred, socketError() if an error occurred
| virtual bool setPayload |
( |
u_int32_t |
payload | ) |
[pure virtual] |
Set the SCTP payload protocol identifier (RFC 4960)
- Parameters:
-
| payload | Payload identifier code |
- Returns:
- True if set successfully
| virtual bool setStreams |
( |
int |
inbound, |
|
|
int |
outbound |
|
) |
| [pure virtual] |
Set the number of streams
- Parameters:
-
| inbound | The number of inbound streams |
| outbound | The number of outbound streams |
- Returns:
- True if the number of streams was set
Subscribe to SCTP events This method should be called if we need to find from which stream the data came
- Returns:
- True if subscription has succeeded
The documentation for this class was generated from the following file: