| Modifier and Type | Field and Description |
|---|---|
| protected FileDescriptor | fd
The file descriptor object. |
| protected int | localPort
The local port number. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract void | bind(int
the local port lport, InetAddress the local address laddr)Binds a datagram socket to a local port and address. |
| protected abstract void | |
| protected void | connect(InetAddress
the remote InetAddress to connect to address, int the remote port number port)Connects a datagram socket to a remote destination. |
| protected abstract void | |
| pack-priv int | |
| protected void | |
| protected FileDescriptor | Returns: aFileDescriptor object representing the datagram socket
file descriptorGets the datagram socket file descriptor. |
| protected int | |
| protected < The type of the socket option value T> T | Returns: the socket optionThe socket option name)Called to get a socket option. |
| protected abstract int | Returns: anint representing the time-to-live valueRetrieve the TTL (time-to-live) option. |
| protected abstract void | |
| protected abstract void | joinGroup(SocketAddress
address to join. mcastaddr, NetworkInterface specifies the local interface to receive multicast
datagram packets netIf)Join the multicast group. |
| protected abstract void | |
| protected abstract void | leaveGroup(SocketAddress
address to leave. mcastaddr, NetworkInterface specified the local interface to leave the group at netIf)Leave the multicast group. |
| protected abstract int | Returns: the port number which the packet came from.an InetAddress object i)Peek at the packet to see who it is from. |
| protected abstract int | Returns: the port number which the packet came from.the Packet Received. p)Peek at the packet to see who it is from. |
| protected abstract void | |
| protected abstract void | |
| protected < The type of the socket option value T> void | setOption(SocketOption<T>
The socket option name, T The value of the socket option. A value of value)null
may be valid for some options.Called to set a socket option. |
| protected abstract void | |
| protected Set | Returns: a Set of SocketOptionsReturns a set of SocketOptions supported by this impl and by this impl's socket (DatagramSocket or MulticastSocket) |
| fd | back to summary |
|---|---|
| protected FileDescriptor fd The file descriptor object. | |
| localPort | back to summary |
|---|---|
| protected int localPort The local port number. | |
| DatagramSocketImpl | back to summary |
|---|---|
| public DatagramSocketImpl() Constructor for subclasses to call. | |
| bind | back to summary |
|---|---|
| protected abstract void bind(int lport, InetAddress laddr) throws SocketException Binds a datagram socket to a local port and address.
| |
| close | back to summary |
|---|---|
| protected abstract void close() Close the socket. | |
| connect | back to summary |
|---|---|
| protected void connect(InetAddress address, int port) throws SocketException Connects a datagram socket to a remote destination. This associates the remote address with the local socket so that datagrams may only be sent to this destination and received from this destination. This may be overridden to call a native system connect. If the remote destination to which the socket is connected does not exist, or is otherwise unreachable, and if an ICMP destination unreachable packet has been received for that address, then a subsequent call to send or receive may throw a PortUnreachableException. Note, there is no guarantee that the exception will be thrown. Implementation Specification The default implementation of this method throws
| |
| create | back to summary |
|---|---|
| protected abstract void create() throws SocketException Creates a datagram socket.
| |
| dataAvailable | back to summary |
|---|---|
| pack-priv int dataAvailable() | |
| disconnect | back to summary |
|---|---|
| protected void disconnect() Disconnects a datagram socket from its remote destination. Implementation Specification The default implementation of this method throws
| |
| getFileDescriptor | back to summary |
|---|---|
| protected FileDescriptor getFileDescriptor() Gets the datagram socket file descriptor.
| |
| getLocalPort | back to summary |
|---|---|
| protected int getLocalPort() Gets the local port.
| |
| getOption | back to summary |
|---|---|
| protected <T> T getOption(SocketOption<T> name) throws IOException Called to get a socket option. Implementation Specification The default implementation of this method first checks that the given
socket option
| |
| getTimeToLive | back to summary |
|---|---|
| protected abstract int getTimeToLive() throws IOException Retrieve the TTL (time-to-live) option.
| |
| join | back to summary |
|---|---|
| protected abstract void join(InetAddress inetaddr) throws IOException Join the multicast group.
| |
| joinGroup | back to summary |
|---|---|
| protected abstract void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf) throws IOException Join the multicast group.
| |
| leave | back to summary |
|---|---|
| protected abstract void leave(InetAddress inetaddr) throws IOException Leave the multicast group.
| |
| leaveGroup | back to summary |
|---|---|
| protected abstract void leaveGroup(SocketAddress mcastaddr, NetworkInterface netIf) throws IOException Leave the multicast group.
| |
| peek | back to summary |
|---|---|
| protected abstract int peek(InetAddress i) throws IOException Peek at the packet to see who it is from. Updates the specified
| |
| peekData | back to summary |
|---|---|
| protected abstract int peekData(DatagramPacket p) throws IOException Peek at the packet to see who it is from. The data is copied into the specified
| |
| receive | back to summary |
|---|---|
| protected abstract void receive(DatagramPacket p) throws IOException Receive the datagram packet.
| |
| send | back to summary |
|---|---|
| protected abstract void send(DatagramPacket p) throws IOException Sends a datagram packet. The packet contains the data and the destination address to send the packet to.
| |
| setOption | back to summary |
|---|---|
| protected <T> void setOption(SocketOption<T> name, T value) throws IOException Called to set a socket option. Implementation Specification The default implementation of this method first checks that the given
socket option
| |
| setTimeToLive | back to summary |
|---|---|
| protected abstract void setTimeToLive(int ttl) throws IOException Set the TTL (time-to-live) option.
| |
| supportedOptions | back to summary |
|---|---|
| protected Set Returns a set of SocketOptions supported by this impl and by this impl's socket (DatagramSocket or MulticastSocket) Implementation Specification The default implementation of this method returns an empty set. Subclasses should override this method with an appropriate implementation.
| |