public class SctpSocket extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
SctpSocket.NotificationListener
Interface used to listen for SCTP notifications on specific socket.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept()
Accepts incoming SCTP connection.
|
void |
close()
Closes this socket.
|
void |
connect(int remotePort)
Initializes SCTP connection by sending INIT message.
|
static void |
debugSctpPacket(byte[] packet,
String id) |
int |
getPort()
Returns SCTP port used by this socket.
|
void |
listen()
Makes SCTP socket passive.
|
void |
onConnIn(byte[] packet,
int offset,
int len)
Call this method to pass network packets received on the link.
|
int |
send(byte[] data,
boolean ordered,
int sid,
int ppid)
Sends given data on selected SCTP stream using given payload
protocol identifier.
|
int |
send(byte[] data,
int offset,
int len,
boolean ordered,
int sid,
int ppid)
Sends given data on selected SCTP stream using given payload
protocol identifier.
|
void |
setDataCallback(SctpDataCallback callback)
Sets the callback that will be fired when new data is received.
|
void |
setLink(NetworkLink link)
Sets the link that will be used to send network packets.
|
void |
setNotificationListener(SctpSocket.NotificationListener l)
Sets the listener that will be notified about SCTP event.
|
String |
toString() |
public static void debugSctpPacket(byte[] packet,
String id)
public boolean accept()
throws IOException
IOExceptionpublic void close()
public void connect(int remotePort)
throws IOException
remotePort - remote SCTP port.IOException - if this socket is closed or an error occurs
while trying to connect the socket.public int getPort()
public void listen()
throws IOException
IOExceptionpublic void onConnIn(byte[] packet,
int offset,
int len)
throws IOException
packet - network packet received.offset - the position in the packet buffer where actual data startslen - length of packet data in the buffer.IOExceptionpublic int send(byte[] data,
boolean ordered,
int sid,
int ppid)
throws IOException
data - the data to send.ordered - should we care about message order ?sid - SCTP stream identifierppid - payload protocol identifierIOExceptionpublic int send(byte[] data,
int offset,
int len,
boolean ordered,
int sid,
int ppid)
throws IOException
data - the data to send.offset - position of the data inside the bufferlen - data lengthordered - should we care about message order ?sid - SCTP stream identifierppid - payload protocol identifierIOExceptionpublic void setDataCallback(SctpDataCallback callback)
callback - the callback that will be fired when new data is
received.public void setLink(NetworkLink link)
link - NetworkLink that will be used by this instance to
send network packets.public void setNotificationListener(SctpSocket.NotificationListener l)
l - the SctpSocket.NotificationListener to set.Copyright © 2021 jitsi.org. All rights reserved.