public interface DatagramSocket
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection.
|
NetworkInterface |
getIface()
Returns the interface.
|
IPAddress |
getSocketAddress()
Returns the address this socket is bound to.
|
int |
getSocketPort()
Returns the port this socket is bound to.
|
Datagram |
receive()
Receives a datagram.
|
void |
release(Datagram datagram)
Returns
datagram to this socket for reusability. |
void |
send(Datagram datagram)
Sends a datagram.
|
void send(Datagram datagram) throws java.io.IOException
Datagram object includes the information indicating what
data to send, its length, and the address of the receiver. The method sends length bytes
starting at the current offset of the Datagram object, where length and
offset are internal state variables of the Datagram object.datagram - A datagram.java.io.IOExceptionDatagram receive() throws java.io.IOException
java.io.IOExceptionvoid close()
throws java.io.IOException
java.io.IOExceptionvoid release(Datagram datagram)
datagram to this socket for reusability.datagram - the datagram, which can be reused by this socketIPAddress getSocketAddress()
int getSocketPort()
NetworkInterface getIface()