|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.i1.sctp.SCTPSocket
public class SCTPSocket
An SCTP socket An SCTP socket behaves in some ways like a TCP socket and in some ways like a datagram socket.
You cannot instantiate a SCTPSocket, but rather one of its two subclasses: OneToOneSCTPSocket
and OneToManySCTPSocket
.
Method Summary | |
---|---|
void |
bind()
Bind to an unspecified address/port. |
void |
bind(java.net.InetAddress addr,
int port)
Deprecated. An important feature of SCTP is multi-homing. This method binds the socket to a single interface and effectively disables multi-homing. This method is only here for completeness' sake. |
void |
bind(java.net.InetSocketAddress bindaddr)
Deprecated. An important feature of SCTP is multi-homing. This method binds the socket to a single interface and effectively disables multi-homing. This method is only here for completeness' sake. |
void |
bind(int port)
Bind to a specific port. |
boolean |
chunkAvailable()
Probe if any unread chunks are pending |
void |
close()
Close the socket. |
void |
configureAutoClose(int seconds)
Configure the auto-close feature. |
void |
configureBlocking(boolean block)
Set the blocking mode. |
void |
connect(java.net.InetAddress addr,
int port)
Create an association to a peer. |
void |
connect(java.net.InetSocketAddress addr)
Create an association to a peer. |
void |
disconnect(AssociationId assoc_id)
Shut down an association. |
void |
disconnect(AssociationId assoc_id,
boolean gracefully)
Shut down an association. |
protected void |
finalize()
|
java.util.Collection<java.net.InetAddress> |
getLocalInetAddresses()
Get local addressed uses by the socket. |
java.util.Collection<java.net.InetAddress> |
getLocalInetAddresses(AssociationId assoc_id)
Get local addresses used by the socket. |
int |
getLocalInetPort()
Get local port. |
java.util.Collection<java.net.InetAddress> |
getPeerInetAddresses(AssociationId assoc_id)
Get addresses of a peer. |
int |
getPeerInetPort(AssociationId assoc_id)
|
int |
getReceiveBufferSize()
Get the SO_RCVBUF option for the socket. |
boolean |
getSctpNoDelay()
Tests if SCTP_NODELAY is enabled. |
int |
getSendBufferSize()
Get the SO_SNDBUF option for the socket. |
boolean |
isBlocking()
Tells whether send() and connect() may block. |
boolean |
isClosed()
Returns the closed state of the socket. |
void |
listen()
Enable inbound connections. |
SCTPChunk |
receive()
Receive a data chunk or a notification. |
SCTPChunk |
receive(long timeout)
Receive a data chunk or a notification. |
SCTPChunk |
receiveNow()
Receive a data chunk or a notification. |
void |
send(SCTPData sctpdata)
Send a datagram to a peer. |
void |
setInitMsg(sctp_initmsg im)
Set default association parameters. |
void |
setPeerParameters(sctp_paddrparams spp)
Set the parameters for a peer. |
void |
setReceiveBufferSize(int size)
Sets the SO_RCVBUF option for this socket. |
void |
setSctpNoDelay(boolean on)
Enable/disable SCTP_NODELAY (disable/enable Nagle's algorithm). |
void |
setSendBufferSize(int size)
Sets the SO_SNDBUF option for this socket. |
void |
subscribeEvents(sctp_event_subscribe ses)
Subscribe to specific SCTP notifications. |
void |
wakeup()
Wake other threads from receive(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void bind() throws java.net.SocketException
java.net.SocketException
public void bind(int port) throws java.net.SocketException
port
- the SCTP port to bind to.
java.net.SocketException
public void bind(java.net.InetSocketAddress bindaddr) throws java.net.SocketException
java.net.SocketException
public void bind(java.net.InetAddress addr, int port) throws java.net.SocketException
java.net.SocketException
public void close() throws java.net.SocketException
java.net.SocketException
public boolean isClosed()
public void subscribeEvents(sctp_event_subscribe ses) throws java.net.SocketException
java.net.SocketException
public void configureAutoClose(int seconds) throws java.net.SocketException
seconds
- Number of seconds without traffic before automatically closing associations. 0 means disable.
java.net.SocketException
public void configureBlocking(boolean block) throws java.net.SocketException
subscribeEvents(dk.i1.sctp.sctp_event_subscribe)
).
When configured in non-blocking send() may throw the WouldBlockException
exception if the send call would block (probably due to OS buffers being full).
block
- If true then send() and connect() any block. If false then send() and connect() will not block
java.net.SocketException
public boolean isBlocking() throws java.net.SocketException
java.net.SocketException
public void setSctpNoDelay(boolean on) throws java.net.SocketException
on
- true to enable TCP_NODELAY, false to disable.
java.net.SocketException
public boolean getSctpNoDelay() throws java.net.SocketException
java.net.SocketException
public int getReceiveBufferSize() throws java.net.SocketException
java.net.SocketException
public int getSendBufferSize() throws java.net.SocketException
java.net.SocketException
public void setReceiveBufferSize(int size) throws java.net.SocketException
java.net.SocketException
public void setSendBufferSize(int size) throws java.net.SocketException
java.net.SocketException
public void setPeerParameters(sctp_paddrparams spp) throws java.net.SocketException
java.net.SocketException
public void setInitMsg(sctp_initmsg im) throws java.net.SocketException
java.net.SocketException
public void listen() throws java.net.SocketException
java.net.SocketException
public void connect(java.net.InetSocketAddress addr) throws java.net.SocketException
java.net.SocketException
public void connect(java.net.InetAddress addr, int port) throws java.net.SocketException
java.net.SocketException
public void disconnect(AssociationId assoc_id) throws java.net.SocketException
java.net.SocketException
public void disconnect(AssociationId assoc_id, boolean gracefully) throws java.net.SocketException
assoc_id
- The association to shut downgracefully
- Controls whether the association is shut down gracefully with SCTP_EOF, or with SCTP_ABORT.
java.net.SocketException
public java.util.Collection<java.net.InetAddress> getLocalInetAddresses() throws java.net.SocketException
java.net.SocketException
public java.util.Collection<java.net.InetAddress> getLocalInetAddresses(AssociationId assoc_id) throws java.net.SocketException
java.net.SocketException
public int getLocalInetPort() throws java.net.SocketException
java.net.SocketException
public java.util.Collection<java.net.InetAddress> getPeerInetAddresses(AssociationId assoc_id)
public int getPeerInetPort(AssociationId assoc_id) throws java.net.SocketException
java.net.SocketException
public boolean chunkAvailable() throws java.net.SocketException
java.net.SocketException
public SCTPChunk receive() throws java.net.SocketException
java.net.SocketException
public SCTPChunk receiveNow() throws java.net.SocketException
java.net.SocketException
public SCTPChunk receive(long timeout) throws java.net.SocketException, java.lang.IllegalArgumentException
timeout
- Milliseconds to wait for an event. 0 means infinite. Must not be negative.
java.net.SocketException
java.lang.IllegalArgumentException
public void send(SCTPData sctpdata) throws java.net.SocketException, WouldBlockException
Example:
SCTPData data = new SCTPData(raw_byte_array); data.sndrcvinfo.sinfo_assoc_id = destination_association_id; sctp_socket.send(data);
sctpdata
- the data chunk to send.
java.net.SocketException
- if a socket error occurs.
WouldBlockException
- if the socket is non-blocking and outgoing OS buffers are full.public void wakeup() throws java.net.SocketException
java.net.SocketException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |