|
More information: http://www.cs.berkeley.edu/~mdw/proj/seda/ | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.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 |
connected, connectedAddress, connectedPort, factory, implClass |
| 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 | |
(package private) static void |
|
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 |
create, getSoTimeout, setDatagramSocketImplFactory, setSoTimeout |
| 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 |
static void()
public void close()
close in class java.net.DatagramSocket
public void connect(java.net.InetAddress address,
int port)
throws java.lang.IllegalArgumentException
connect in class java.net.DatagramSocket
public void connect(java.lang.String host,
int port)
throws java.net.UnknownHostException
public void disconnect()
disconnect in class java.net.DatagramSocketpublic java.net.InetAddress getInetAddress()
getInetAddress in class java.net.DatagramSocketpublic java.net.InetAddress getLocalAddress()
getLocalAddress in class java.net.DatagramSocketpublic int getPort()
getPort in class java.net.DatagramSocketpublic int getLocalPort()
getLocalPort in class java.net.DatagramSocket
public int nbReceive(java.net.DatagramPacket p)
throws java.io.IOException
public int nbReceive(byte[] data,
int offset,
int length)
throws java.io.IOException
public int nbSend(java.net.DatagramPacket p)
throws java.io.IOException
public int nbSend(byte[] data,
int offset,
int length,
java.net.InetAddress addr,
int port)
throws java.io.IOException
public int nbSend(byte[] data,
int offset,
int length)
throws java.io.IOException
public int getReceiveBufferSize()
throws java.net.SocketException
getReceiveBufferSize in class java.net.DatagramSocket
public int getSendBufferSize()
throws java.net.SocketException
getSendBufferSize in class java.net.DatagramSocket
public void setReceiveBufferSize(int size)
throws java.net.SocketException
setReceiveBufferSize in class java.net.DatagramSocket
public void setSendBufferSize(int size)
throws java.net.SocketException
setSendBufferSize in class java.net.DatagramSocket
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.
send in class java.net.DatagramSocket
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.
receive in class java.net.DatagramSocket
|
More information: http://www.cs.berkeley.edu/~mdw/proj/seda/ | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||