Methods Summary |
---|
protected abstract void | bind(int port, java.net.InetAddress addr)Binds the datagram socket to the given localhost/port. Sockets must be
bound prior to attempting to send or receive data.
|
protected abstract void | close()Closes this socket.
|
protected void | connect(java.net.InetAddress inetAddr, int port)Connects this socket to the specified remote address and port.
// do nothing
|
protected abstract void | create()This method allocates the socket descriptor in the underlying operating
system.
|
protected void | disconnect()Disconnects this socket from the remote host.
// do nothing
|
protected java.io.FileDescriptor | getFileDescriptor()Gets the {@code FileDescriptor} of this datagram socket, which is invalid
if the socket is closed or not bound.
return fd;
|
java.net.InetAddress | getLocalAddress()Gets the local address to which the socket is bound.
return Platform.getNetworkSystem().getSocketLocalAddress(fd,
NetUtil.preferIPv6Addresses());
|
protected int | getLocalPort()Gets the local port of this socket.
return localPort;
|
public abstract java.lang.Object | getOption(int optID)Gets the value for the specified socket option.
|
protected abstract byte | getTTL()Gets the time-to-live (TTL) for multicast packets sent on this socket.
|
protected abstract int | getTimeToLive()Gets the time-to-live (TTL) for multicast packets sent on this socket.
The TTL option defines how many routers a packet may be pass before it is
discarded.
|
protected abstract void | join(java.net.InetAddress addr)Adds this socket to the multicast group {@code addr}. A socket must join
a group before being able to receive data. Further, a socket may be a
member of multiple groups but may join any group only once.
|
protected abstract void | joinGroup(java.net.SocketAddress addr, java.net.NetworkInterface netInterface)Adds this socket to the multicast group {@code addr}. A socket must join
a group before being able to receive data. Further, a socket may be a
member of multiple groups but may join any group only once.
|
protected abstract void | leave(java.net.InetAddress addr)Removes this socket from the multicast group {@code addr}.
|
protected abstract void | leaveGroup(java.net.SocketAddress addr, java.net.NetworkInterface netInterface)Removes this socket from the multicast group {@code addr}.
|
protected abstract int | peek(java.net.InetAddress sender)Peeks at the incoming packet to this socket and returns the address of
the {@code sender}. The method will block until a packet is received or
timeout expires.
|
protected abstract int | peekData(java.net.DatagramPacket pack)Receives data into the supplied datagram packet by peeking. The data is
not removed from socket buffer and can be received again by another
{@code peekData()} or {@code receive()} call. This call blocks until
either data has been received or, if a timeout is set, the timeout has
been expired.
|
protected abstract void | receive(java.net.DatagramPacket pack)Receives data and stores it in the supplied datagram packet {@code pack}.
This call will block until either data has been received or, if a timeout
is set, the timeout has expired. If the timeout expires an {@code
InterruptedIOException} is thrown.
|
protected abstract void | send(java.net.DatagramPacket pack)Sends the given datagram packet {@code pack}. The packet contains the
data and the address and port information of the target host as well.
|
public abstract void | setOption(int optID, java.lang.Object val)Sets the value for the specified socket option.
|
protected abstract void | setTTL(byte ttl)Sets the time-to-live (TTL) option for multicast packets sent on this
socket.
|
protected abstract void | setTimeToLive(int ttl)Sets the time-to-live (TTL) option for multicast packets sent on this
socket.
|