AFSocketAddress that is supported by this type.
DatagramSocket implementation that works with junixsocket.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | AFDatagramSocket.
The concrete A extends AFSocketAddress>AFSocketAddress that is supported by this type.A reference to the constructor of an |
| Modifier and Type | Field and Description |
|---|---|
| private final AncillaryDataSupport | |
| private final AFDatagramChannel | |
| private final AtomicBoolean | |
| private final AtomicBoolean | |
| private final AFDatagramSocketImpl | |
| private static final InetSocketAddress |
| Access | Constructor and Description |
|---|---|
| protected | AFDatagramSocket(final AFDatagramSocketImpl<A>
The corresponding impl)SocketImpl class.Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public AFDatagramSocket | |
| pack-priv AFDatagramSocket | |
| protected final AFAddressFamily | |
| public final synchronized void | bind(SocketAddress
The address and port to bind to. addr)Overrides java. Binds this DatagramSocket to a specific address and port. |
| public final void | close()
Overrides java. Implements java. Closes this stream and releases any system resources associated with it. |
| public final void | connect(InetAddress
the remote address for the socket address, int the remote port for the socket. port)Overrides java. Connects the socket to a remote address for this socket. |
| public final synchronized void | connect(SocketAddress
The remote address. addr)Overrides java. Connects this socket to a remote socket address (IP address + port number). |
| public final void | ensureAncillaryReceiveBufferSize(int
The minimum size (in bytes). minSize)Implements org. Ensures a minimum ancillary receive buffer size. |
| pack-priv final AFDatagramSocketImpl | |
| pack-priv final AFDatagramSocketImpl | |
| pack-priv final AncillaryDataSupport | |
| public final int | getAncillaryReceiveBufferSize()
Implements org. Returns the size of the receive buffer for ancillary messages (in bytes). |
| public AFDatagramChannel | getChannel()
Overrides java. Returns the unique |
| public final FileDescriptor | getFileDescriptor()
Implements org. Returns the corresponding |
| protected AFSocketImplExtensions | Returns: The helper instance.Returns the internal helper instance for address-specific extensions. |
| public final @Nullable A | getLocalSocketAddress()
Overrides java. Implements org. Returns the socket's local socket address, or |
| public < The type of the socket option value. T> T | Returns: The value of the socket option.The socket option. name)Implements abstract org. Returns the value of a junixsocket socket option. |
| public final synchronized @Nullable A | getRemoteSocketAddress()
Overrides java. Implements org. Returns the socket's remote socket address, or |
| pack-priv final void | |
| pack-priv final void | |
| public final boolean | |
| public final boolean | |
| public final boolean | isConnected()
Overrides java. Returns the connection state of the socket. |
| public final boolean | |
| public final void | |
| protected abstract AFDatagramChannel | |
| protected abstract AFDatagramSocket | Returns: The new instance.Returns a new |
| protected static final < The concrete A extends AFSocketAddress> AFDatagramSocketAFSocketAddress that is supported by this type. | Returns: The new instance.The supplying constructor. constructorReturns a new |
| protected static final < The concrete A extends AFSocketAddress> AFDatagramSocketAFSocketAddress that is supported by this type. | Returns: The new instance.The supplying constructor. constructor,The file descriptor. fdObj, int The local port. localPort, int The remote port. remotePort)Creates a new |
| public final void | peek(DatagramPacket
The packet. p)Reads the next received packet without actually removing it from the queue. |
| public final void | receive(DatagramPacket
the p)DatagramPacket into which to place
the incoming data.Overrides java. Receives a datagram packet from this socket. |
| public final void | send(DatagramPacket
the p)DatagramPacket to be sent.Overrides java. Sends a datagram packet from this socket. |
| public final void | setAncillaryReceiveBufferSize(int
The size. size)Implements org. Sets the size of the receive buffer for ancillary messages (in bytes). |
| public final void | setDeleteOnClose(boolean
Enabled if b)true.Enables/disables deleting this |
| public < The type of the socket option value. T> DatagramSocket | Returns: this DatagramSocket.The socket option. name, T The value of the socket option. value)Implements abstract org. Sets the value of a socket option. |
| public void | setShutdownOnClose(boolean
true if enabled.Implements org. Configures whether the socket should be shutdown upon |
| protected final Class | Returns: The supportedAFSocketAddress.Returns the |
| ancillaryDataSupport | back to summary |
|---|---|
| private final AncillaryDataSupport ancillaryDataSupport | |
| channel | back to summary |
|---|---|
private final AFDatagramChannel<A> channel
| |
| created | back to summary |
|---|---|
| private final AtomicBoolean created | |
| deleteOnClose | back to summary |
|---|---|
| private final AtomicBoolean deleteOnClose | |
| impl | back to summary |
|---|---|
| private final AFDatagramSocketImpl<A> impl | |
| WILDCARD_ADDRESS | back to summary |
|---|---|
| private static final InetSocketAddress WILDCARD_ADDRESS | |
| AFDatagramSocket | back to summary |
|---|---|
| protected AFDatagramSocket(final AFDatagramSocketImpl<A> impl) Creates a new
| |
| accept | back to summary |
|---|---|
| public AFDatagramSocket Accepts a connection to this socket. Note that 1., the socket must be in
| |
| accept1 | back to summary |
|---|---|
| pack-priv AFDatagramSocket | |
| addressFamily | back to summary |
|---|---|
| protected final AFAddressFamily Returns the address family supported by this implementation.
| |
| bind | back to summary |
|---|---|
| public final synchronized void bind(SocketAddress addr) throws SocketException Overrides java. Doc from java. Binds this DatagramSocket to a specific address and port.
If the address is
| |
| close | back to summary |
|---|---|
| public final void close() Overrides java. Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| connect | back to summary |
|---|---|
| public final void connect(InetAddress address, int port) Overrides java. Doc from java. Connects the socket to a remote address for this socket. When a socket is connected to a remote address, packets may only be sent to or received from that address. By default a datagram socket is not connected. If the socket is already closed, then this method has no effect. If this socket is not bound then this method will first cause the
socket to be bound to an address that is assigned automatically,
as if invoking the If this socket is already connected, then this method will attempt to connect to the given address. If this connect fails then the state of this socket is unknown - it may or may not be connected to the address that it was previously connected to. When the socket is connected, the send method checks that the packet's address matches the remote address that the socket is connected to. A socket connected to a multicast address may only be used to send packets. Datagrams in the socket's socket receive buffer, which have not been received before invoking this method, may be discarded.
| |
| connect | back to summary |
|---|---|
| public final synchronized void connect(SocketAddress addr) throws SocketException Overrides java. Doc from java. Connects this socket to a remote socket address (IP address + port number). If given an If this socket is already connected, then this method will attempt to connect to the given address. If this connect fails then the state of this socket is unknown - it may or may not be connected to the address that it was previously connected to.
| |
| ensureAncillaryReceiveBufferSize | back to summary |
|---|---|
| public final void ensureAncillaryReceiveBufferSize(int minSize) Implements org. Doc from org. Ensures a minimum ancillary receive buffer size.
| |
| getAFImpl | back to summary |
|---|---|
| pack-priv final AFDatagramSocketImpl | |
| getAFImpl | back to summary |
|---|---|
| pack-priv final AFDatagramSocketImpl | |
| getAncillaryDataSupport | back to summary |
|---|---|
| pack-priv final AncillaryDataSupport getAncillaryDataSupport() Returns the
| |
| getAncillaryReceiveBufferSize | back to summary |
|---|---|
| public final int getAncillaryReceiveBufferSize() Implements org. Doc from org. Returns the size of the receive buffer for ancillary messages (in bytes).
| |
| getChannel | back to summary |
|---|---|
| public AFDatagramChannel Overrides java. Doc from java. Returns the unique A datagram socket will have a channel if, and only if, the channel
itself was created via the
| |
| getFileDescriptor | back to summary |
|---|---|
| public final FileDescriptor getFileDescriptor() throws IOException Implements org. Doc from org. Returns the corresponding
| |
| getImplExtensions | back to summary |
|---|---|
| protected AFSocketImplExtensions Returns the internal helper instance for address-specific extensions.
| |
| getLocalSocketAddress | back to summary |
|---|---|
| public final @Nullable A getLocalSocketAddress() Overrides java. Implements org. Doc from org. Returns the socket's local socket address, or | |
| getOption | back to summary |
|---|---|
| public <T> T getOption(AFSocketOption<T> name) throws IOException Implements abstract org. Returns the value of a junixsocket socket option.
| |
| getRemoteSocketAddress | back to summary |
|---|---|
| public final synchronized @Nullable A getRemoteSocketAddress() Overrides java. Implements org. Doc from org. Returns the socket's remote socket address, or | |
| internalDummyBind | back to summary |
|---|---|
| pack-priv final void internalDummyBind() throws SocketException | |
| internalDummyConnect | back to summary |
|---|---|
| pack-priv final void internalDummyConnect() throws SocketException | |
| isBound | back to summary |
|---|---|
| public final boolean isBound() Overrides java. Doc from java. Returns the binding state of the socket.
If the socket was bound prior to being
| |
| isClosed | back to summary |
|---|---|
| public final boolean isClosed() Overrides java. Doc from java. Returns whether the socket is closed or not.
| |
| isConnected | back to summary |
|---|---|
| public final boolean isConnected() Overrides java. Doc from java. Returns the connection state of the socket.
If the socket was connected prior to being
| |
| isDeleteOnClose | back to summary |
|---|---|
| public final boolean isDeleteOnClose() Checks if this
| |
| listen | back to summary |
|---|---|
| public final void listen(int backlog) throws IOException Sets this socket into "listen" state, which allows subsequent calls to
| |
| newChannel | back to summary |
|---|---|
| protected abstract AFDatagramChannel Creates a new
| |
| newDatagramSocketInstance | back to summary |
|---|---|
| protected abstract AFDatagramSocket Returns a new
| |
| newInstance | back to summary |
|---|---|
| protected static final <A extends AFSocketAddress> AFDatagramSocket Returns a new
| |
| newInstance | back to summary |
|---|---|
| protected static final <A extends AFSocketAddress> AFDatagramSocket Creates a new
| |
| peek | back to summary |
|---|---|
| public final void peek(DatagramPacket p) throws IOException Reads the next received packet without actually removing it from the queue. In other words, once a packet is received, calling this method multiple times in a row will not have further effects on the packet contents. This call still blocks until at least one packet has been received and added to the queue.
| |
| receive | back to summary |
|---|---|
| public final void receive(DatagramPacket p) throws IOException Overrides java. Doc from java. Receives a datagram packet from this socket. This method blocks until a
datagram is received.
When this method returns, the This method is interruptible in the following circumstances:
| |
| send | back to summary |
|---|---|
| public final void send(DatagramPacket p) throws IOException Overrides java. Doc from java. Sends a datagram packet from this socket. The
| |
| setAncillaryReceiveBufferSize | back to summary |
|---|---|
| public final void setAncillaryReceiveBufferSize(int size) Implements org. Doc from org. Sets the size of the receive buffer for ancillary messages (in bytes). To disable handling ancillary messages, set it to 0 (default).
| |
| setDeleteOnClose | back to summary |
|---|---|
| public final void setDeleteOnClose(boolean b) Enables/disables deleting this
| |
| setOption | back to summary |
|---|---|
| public <T> DatagramSocket setOption(AFSocketOption<T> name, T value) throws IOException Implements abstract org. Sets the value of a socket option.
| |
| setShutdownOnClose | back to summary |
|---|---|
| public void setShutdownOnClose(boolean enabled) Implements org. Doc from org. Configures whether the socket should be shutdown upon
| |
| socketAddressClass | back to summary |
|---|---|
| protected final Class Returns the
| |
AFSocketAddress that is supported by this type.
AFDatagramSocket subclass.
| Modifier and Type | Method and Description |
|---|---|
| public AFDatagramSocket | Returns: The new instance.The file descriptor. fd)Constructs a new |
| newSocket | back to summary |
|---|---|
| public AFDatagramSocket Constructs a new
| |