DatagramSocketImpl implemented by junixsocket.
| Modifier and Type | Field and Description |
|---|---|
| private final AFAddressFamily | |
| pack-priv final AncillaryDataSupport | |
| private final AtomicBoolean | |
| private final AtomicBoolean | |
| private final AFSocketCore | |
| private AFSocketImplExtensions | |
| private int | |
| private int | |
| private final AtomicInteger | |
| private final AFSocketType |
| Access | Constructor and Description |
|---|---|
| protected | AFDatagramSocketImpl(AFAddressFamily<@NonNull A>
The address family. addressFamily, FileDescriptor The file descriptor, or fd, AFSocketType null.The socket type. socketType)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final boolean | |
| protected final void | bind(int
the local port lport, InetAddress the local address laddr)Implements abstract java. Binds a datagram socket to a local port and address. |
| pack-priv final void | |
| protected final void | |
| protected final void | connect(InetAddress
the remote InetAddress to connect to address, int the remote port number port)Overrides java. Connects a datagram socket to a remote destination. |
| pack-priv final void | |
| protected final void | |
| protected final void | disconnect()
Overrides java. Disconnects a datagram socket from its remote destination. |
| protected final AFAddressFamily | |
| pack-priv final AFSocketCore | |
| protected final FileDescriptor | getFileDescriptor()
Overrides java. Gets the datagram socket file descriptor. |
| protected final synchronized AFSocketImplExtensions | Returns: The helper instance.Returns the internal helper instance for address-specific extensions. |
| pack-priv final int | |
| pack-priv final @Nullable A | |
| public Object | getOption(int
an optID)int identifying the option to fetchImplements java. Fetch the value of an option. |
| pack-priv final int | |
| pack-priv final @Nullable A | |
| protected final int | getTimeToLive()
Implements abstract java. Retrieve the TTL (time-to-live) option. |
| protected final byte | getTTL()
Implements abstract java.
Deprecated
Retrieve the TTL (time-to-live) option. |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| protected final void | join(InetAddress
multicast address to join. inetaddr)Implements abstract java. Join the multicast group. |
| protected final void | joinGroup(SocketAddress
address to join. mcastaddr, NetworkInterface specifies the local interface to receive multicast
datagram packets netIf)Implements abstract java. Join the multicast group. |
| protected final void | leave(InetAddress
multicast address to leave. inetaddr)Implements abstract java. Leave the multicast group. |
| protected final void | leaveGroup(SocketAddress
address to leave. mcastaddr, NetworkInterface specified the local interface to leave the group at netIf)Implements abstract java. Leave the multicast group. |
| protected final int | peek(InetAddress
an InetAddress object i)Implements abstract java. Peek at the packet to see who it is from. |
| protected final int | peekData(DatagramPacket
the Packet Received. p)Implements abstract java. Peek at the packet to see who it is from. |
| pack-priv final int | |
| protected final void | receive(DatagramPacket
the Packet Received. p)Implements abstract java. Receive the datagram packet. |
| pack-priv final A | |
| private void | |
| protected final void | send(DatagramPacket
the packet to be sent. p)Implements abstract java. Sends a datagram packet. |
| pack-priv final int | |
| public void | setOption(int
identifies the option optID, Object the parameter of the socket option value)Implements java. Enable/disable the option specified by |
| pack-priv final void | |
| protected final void | setTimeToLive(int
an ttl)int specifying the time-to-live valueImplements abstract java. Set the TTL (time-to-live) option. |
| protected final void | setTTL(byte
a byte specifying the TTL value ttl)Implements abstract java.
Deprecated
Set the TTL (time-to-live) option. |
| pack-priv final void | |
| pack-priv final int |
| addressFamily | back to summary |
|---|---|
| private final AFAddressFamily<@NonNull A> addressFamily | |
| ancillaryDataSupport | back to summary |
|---|---|
| pack-priv final AncillaryDataSupport ancillaryDataSupport | |
| bound | back to summary |
|---|---|
| private final AtomicBoolean bound | |
| connected | back to summary |
|---|---|
| private final AtomicBoolean connected | |
| core | back to summary |
|---|---|
| private final AFSocketCore core | |
| implExtensions | back to summary |
|---|---|
| private AFSocketImplExtensions<A> implExtensions | |
| localPort | back to summary |
|---|---|
| private int localPort | |
| remotePort | back to summary |
|---|---|
| private int remotePort | |
| socketTimeout | back to summary |
|---|---|
| private final AtomicInteger socketTimeout | |
| socketType | back to summary |
|---|---|
| private final AFSocketType socketType | |
| AFDatagramSocketImpl | back to summary |
|---|---|
| protected AFDatagramSocketImpl(AFAddressFamily<@NonNull A> addressFamily, FileDescriptor fd, AFSocketType socketType) Constructs a new
| |
| accept0 | back to summary |
|---|---|
pack-priv final boolean accept0(AFDatagramSocketImpl<A> socket) throws IOException
| |
| bind | back to summary |
|---|---|
| protected final void bind(int lport, InetAddress laddr) throws SocketException Implements abstract java. Doc from java. Binds a datagram socket to a local port and address.
| |
| bind | back to summary |
|---|---|
| pack-priv final void bind(AFSocketAddress socketAddress) throws SocketException | |
| close | back to summary |
|---|---|
| protected final void close() Implements abstract java. Doc from java. Close the socket.
| |
| connect | back to summary |
|---|---|
| protected final void connect(InetAddress address, int port) throws SocketException Overrides java. Doc from java. 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.
| |
| connect | back to summary |
|---|---|
| pack-priv final void connect(AFSocketAddress socketAddress) throws IOException | |
| create | back to summary |
|---|---|
| protected final void create() throws SocketException Implements abstract java. Doc from java. Creates a datagram socket.
| |
| disconnect | back to summary |
|---|---|
| protected final void disconnect() Overrides java. Doc from java. Disconnects a datagram socket from its remote destination.
| |
| getAddressFamily | back to summary |
|---|---|
| protected final AFAddressFamily Returns the address family supported by this implementation.
| |
| getCore | back to summary |
|---|---|
| pack-priv final AFSocketCore getCore() | |
| getFileDescriptor | back to summary |
|---|---|
| protected final FileDescriptor getFileDescriptor() Overrides java. Doc from java. Gets the datagram socket file descriptor.
| |
| getImplExtensions | back to summary |
|---|---|
| protected final synchronized AFSocketImplExtensions Returns the internal helper instance for address-specific extensions.
| |
| getLocalPort1 | back to summary |
|---|---|
| pack-priv final int getLocalPort1() | |
| getLocalSocketAddress | back to summary |
|---|---|
| pack-priv final @Nullable A getLocalSocketAddress() | |
| getOption | back to summary |
|---|---|
| public Object getOption(int optID) throws SocketException Implements java. Doc from java. Fetch the value of an option. Binary options will return SocketImpl s; ... Boolean noDelay = (Boolean)(s.getOption(TCP_NODELAY)); if (noDelay.booleanValue()) { // true if TCP_NODELAY is enabled... ... }
For options that take a particular type as a parameter, this method will return the
parameter's value, else it will return Object o = s.getOption(SO_LINGER); if (o instanceof Integer) { System.out.print("Linger time is " + ((Integer)o).intValue()); } else { // the true type of o is java.lang.Boolean.FALSE; }
| |
| getRemotePort | back to summary |
|---|---|
| pack-priv final int getRemotePort() | |
| getRemoteSocketAddress | back to summary |
|---|---|
| pack-priv final @Nullable A getRemoteSocketAddress() | |
| getTimeToLive | back to summary |
|---|---|
| protected final int getTimeToLive() throws IOException Implements abstract java. Doc from java. Retrieve the TTL (time-to-live) option.
| |
| getTTL | back to summary |
|---|---|
| protected final byte getTTL() throws IOException Implements abstract java. Doc from java. Deprecated
Retrieve the TTL (time-to-live) option.
| |
| isBound | back to summary |
|---|---|
| pack-priv final boolean isBound() | |
| isClosed | back to summary |
|---|---|
| pack-priv final boolean isClosed() | |
| isConnected | back to summary |
|---|---|
| pack-priv final boolean isConnected() | |
| join | back to summary |
|---|---|
| protected final void join(InetAddress inetaddr) throws IOException Implements abstract java. Doc from java. Join the multicast group.
| |
| joinGroup | back to summary |
|---|---|
| protected final void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf) throws IOException Implements abstract java. Doc from java. Join the multicast group.
| |
| leave | back to summary |
|---|---|
| protected final void leave(InetAddress inetaddr) throws IOException Implements abstract java. Doc from java. Leave the multicast group.
| |
| leaveGroup | back to summary |
|---|---|
| protected final void leaveGroup(SocketAddress mcastaddr, NetworkInterface netIf) throws IOException Implements abstract java. Doc from java. Leave the multicast group.
| |
| peek | back to summary |
|---|---|
| protected final int peek(InetAddress i) throws IOException Implements abstract java. Doc from java. Peek at the packet to see who it is from. Updates the specified
| |
| peekData | back to summary |
|---|---|
| protected final int peekData(DatagramPacket p) throws IOException Implements abstract java. Doc from java. Peek at the packet to see who it is from. The data is copied into the specified
| |
| read | back to summary |
|---|---|
| pack-priv final int read(ByteBuffer dst, ByteBuffer socketAddressBuffer) throws IOException | |
| receive | back to summary |
|---|---|
| protected final void receive(DatagramPacket p) throws IOException Implements abstract java. Doc from java. Receive the datagram packet.
| |
| receive | back to summary |
|---|---|
pack-priv final A receive(ByteBuffer dst) throws IOException
| |
| recv | back to summary |
|---|---|
private void recv(DatagramPacket p, int options) throws IOException
| |
| send | back to summary |
|---|---|
| protected final void send(DatagramPacket p) throws IOException Implements abstract java. Doc from java. Sends a datagram packet. The packet contains the data and the destination address to send the packet to.
| |
| send | back to summary |
|---|---|
| pack-priv final int send(ByteBuffer src, SocketAddress target) throws IOException | |
| setOption | back to summary |
|---|---|
| public void setOption(int optID, Object value) throws SocketException Implements java. Doc from java. Enable/disable the option specified by SocketImpl s; ... s.setOption(SO_LINGER, Integer.valueOf(10)); // OK - set SO_LINGER w/ timeout of 10 sec. s.setOption(SO_LINGER, Double.valueOf(10)); // ERROR - expects java.lang.Integer Boolean:
s.setOption(TCP_NODELAY, Boolean.TRUE); // OK - enables TCP_NODELAY, a binary option Boolean#FALSE:
s.setOption(TCP_NODELAY, Boolean.FALSE); // OK - disables TCP_NODELAY s.setOption(SO_LINGER, Boolean.FALSE); // OK - disables SO_LINGER Boolean#FALSE implicitly enables it.
| |
| setSocketAddress | back to summary |
|---|---|
| pack-priv final void setSocketAddress(AFSocketAddress socketAddress) | |
| setTimeToLive | back to summary |
|---|---|
| protected final void setTimeToLive(int ttl) throws IOException Implements abstract java. Doc from java. Set the TTL (time-to-live) option.
| |
| setTTL | back to summary |
|---|---|
| protected final void setTTL(byte ttl) throws IOException Implements abstract java. Doc from java. Deprecated
Set the TTL (time-to-live) option.
| |
| updatePorts | back to summary |
|---|---|
| pack-priv final void updatePorts(int local, int remote) | |
| write | back to summary |
|---|---|
| pack-priv final int write(ByteBuffer src) throws IOException | |