|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.DatagramSocket
seda.nbio.NonblockingDatagramSocket
A NonblockingDatagramSocket provides non-blocking UDP (datagram) I/O.
Field Summary | |
(package private) NonblockingSocketImpl |
impl
|
(package private) boolean |
is_connected
|
Fields inherited from class java.net.DatagramSocket |
|
Fields inherited from interface seda.nbio.Selectable |
ACCEPT_READY, CONNECT_READY, READ_READY, SELECT_ERROR, WRITE_READY |
Constructor Summary | |
NonblockingDatagramSocket()
Create a NonblockingDatagramSocket bound to any available port. |
|
NonblockingDatagramSocket(int port)
Create a NonblockingDatagramSocket bound to the given port. |
|
NonblockingDatagramSocket(int port,
java.net.InetAddress laddr)
Create a NonblockingDatagramSocket bound to the given port and the given local address. |
Method Summary | |
void |
close()
Close this NonblockingDatagramSocket. |
void |
connect(java.net.InetAddress address,
int port)
Connect this NonblockingDatagramSocket to the given address and port. |
void |
connect(java.lang.String host,
int port)
|
void |
disconnect()
|
java.net.InetAddress |
getInetAddress()
Return the remote address to which this socket is bound. |
java.net.InetAddress |
getLocalAddress()
Return the local address to which this socket is bound. |
int |
getLocalPort()
Return the local port to which this socket is bound. |
int |
getPort()
Return the remote port to which this socket is bound. |
int |
getReceiveBufferSize()
|
int |
getSendBufferSize()
|
int |
nbReceive(byte[] data,
int offset,
int length)
Receive a datagram from this socket. |
int |
nbReceive(java.net.DatagramPacket p)
Receive a datagram from this socket. |
int |
nbSend(byte[] data,
int offset,
int length)
Sends a datagram packet from this socket. |
int |
nbSend(byte[] data,
int offset,
int length,
java.net.InetAddress addr,
int port)
Sends a datagram packet from this socket. |
int |
nbSend(java.net.DatagramPacket p)
Sends a datagram packet from this socket. |
void |
receive(java.net.DatagramPacket p)
This method is provided for convenience and mimics blocking behavior by invoking the nonblocking nbReceive() operation. |
void |
send(java.net.DatagramPacket p)
This method is provided for convenience and mimics blocking behavior by invoking the nonblocking nbSend() operation. |
void |
setReceiveBufferSize(int size)
|
void |
setSendBufferSize(int size)
|
Methods inherited from class java.net.DatagramSocket |
bind, connect, getBroadcast, getChannel, getLocalSocketAddress, getRemoteSocketAddress, getReuseAddress, getSoTimeout, getTrafficClass, isBound, isClosed, isConnected, setBroadcast, setDatagramSocketImplFactory, setReuseAddress, setSoTimeout, setTrafficClass |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
NonblockingSocketImpl impl
boolean is_connected
Constructor Detail |
public NonblockingDatagramSocket() throws java.io.IOException
public NonblockingDatagramSocket(int port) throws java.io.IOException
public NonblockingDatagramSocket(int port, java.net.InetAddress laddr) throws java.io.IOException
Method Detail |
public void close()
public void connect(java.net.InetAddress address, int port) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void connect(java.lang.String host, int port) throws java.net.UnknownHostException
java.net.UnknownHostException
public void disconnect()
public java.net.InetAddress getInetAddress()
public java.net.InetAddress getLocalAddress()
public int getPort()
public int getLocalPort()
public int nbReceive(java.net.DatagramPacket p) throws java.io.IOException
java.io.IOException
public int nbReceive(byte[] data, int offset, int length) throws java.io.IOException
java.io.IOException
public int nbSend(java.net.DatagramPacket p) throws java.io.IOException
java.io.IOException
public int nbSend(byte[] data, int offset, int length, java.net.InetAddress addr, int port) throws java.io.IOException
java.io.IOException
public int nbSend(byte[] data, int offset, int length) throws java.io.IOException
java.io.IOException
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 send(java.net.DatagramPacket p) throws java.io.IOException
Use of this method is not recommended and is provided only for compatibility with java.net.DatagramSocket.
java.io.IOException
public void receive(java.net.DatagramPacket p) throws java.io.IOException
Use of this method is not recommended and is provided only for compatibility with java.net.DatagramSocket.
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |