public class SEDatagramSocket extends java.lang.Object implements DatagramSocket
| Constructor and Description |
|---|
SEDatagramSocket(IPAddress socketAddress,
int port,
NetworkInterface iface,
AddressFilter filter)
For Multicast and Unicast Listening
|
SEDatagramSocket(IPAddress socketAddress,
int port,
NetworkInterface iface,
AddressFilter filter,
boolean forceMulticastSocket) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection.
|
boolean |
equals(java.lang.Object obj) |
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.
|
int |
hashCode() |
Datagram |
receive()
Receives a datagram.
|
void |
release(Datagram datagram)
Returns
datagram to this socket for reusability. |
void |
send(Datagram datagram)
Sends a datagram.
|
java.lang.String |
toString() |
public SEDatagramSocket(IPAddress socketAddress, int port, NetworkInterface iface, AddressFilter filter) throws java.io.IOException
socketAddress - port - iface - java.io.IOExceptionpublic SEDatagramSocket(IPAddress socketAddress, int port, NetworkInterface iface, AddressFilter filter, boolean forceMulticastSocket) throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
DatagramSocketclose in interface DatagramSocketjava.io.IOExceptionpublic Datagram receive() throws java.io.IOException
DatagramSocketreceive in interface DatagramSocketjava.io.IOExceptionpublic void send(Datagram datagram) throws java.io.IOException
DatagramSocketDatagram 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.send in interface DatagramSocketdatagram - A datagram.java.io.IOExceptionpublic void release(Datagram datagram)
DatagramSocketdatagram to this socket for reusability.release in interface DatagramSocketdatagram - the datagram, which can be reused by this socketpublic java.lang.String toString()
toString in class java.lang.Objectpublic IPAddress getSocketAddress()
DatagramSocketgetSocketAddress in interface DatagramSocketpublic int getSocketPort()
DatagramSocketgetSocketPort in interface DatagramSocketpublic NetworkInterface getIface()
DatagramSocketgetIface in interface DatagramSocketpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object