AFSocketAddress that is supported by this type.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | AFServerSocket.
The concrete A extends AFSocketAddress>AFSocketAddress that is supported by this type.The constructor of the concrete subclass. |
| Modifier and Type | Field and Description |
|---|---|
| private @Nullable SocketAddressFilter | |
| private @Nullable A | |
| private final AFServerSocketChannel | |
| private final Closeables | |
| private final AtomicBoolean | |
| private final AtomicBoolean | |
| private final AtomicBoolean | |
| private final AFSocketImpl |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | AFServerSocket(FileDescriptor
The file descriptor, or fdObj)null.Constructs a new instance, optionally associated with the given file descriptor. |
| Modifier and Type | Method and Description |
|---|---|
| public AFSocket | accept()
Overrides java. Listens for a connection to be made to this socket and accepts it. |
| pack-priv AFSocket | |
| public final void | addCloseable(Closeable
The closeable. closeable)Registers a |
| protected final AFAddressFamily | |
| public final void | bind(SocketAddress
The IP address and port number to bind to. endpoint)Overrides java. Binds the |
| public final void | bind(SocketAddress
The IP address and port number to bind to. endpoint, int requested maximum length of the queue of
incoming connections. backlog)Overrides java. Binds the |
| public final AFServerSocket | Returns: This instance.The function that gets called for each hook)bind call.Sets the hook for any subsequent call to |
| protected static < The concrete A extends AFSocketAddress> AFServerSocketAFSocketAddress that is supported by this type. | Returns: The new, boundAFServerSocket.The constructor of the concrete subclass. instanceSupplier,The socket file to bind to. addr)Returns a new |
| protected static < The concrete A extends AFSocketAddress> AFServerSocketAFSocketAddress that is supported by this type. | Returns: The new, boundAFServerSocket.The constructor of the concrete subclass. instanceSupplier,The socket file to bind to. addr, boolean If deleteOnClose)true, the socket file (if the address points to a file) will be
deleted upon close.Returns a new |
| private synchronized @Nullable A | |
| public void | close()
Overrides java. Implements java. Closes this stream and releases any system resources associated with it. |
| public final AFServerSocket | Returns: ThisAFServerSocket.The forced endpoint address. endpoint)Forces the address to be used for any subsequent call to |
| protected static < The concrete A extends AFSocketAddress> AFServerSocketAFSocketAddress that is supported by this type. | Returns: The new, yet unboundAFServerSocket.The constructor of the concrete subclass. instanceSupplier,The address to use. forceAddr)Returns a new, unbound |
| pack-priv final AFSocketImpl | |
| public AFServerSocketChannel | getChannel()
Overrides java. Returns the unique |
| public final FileDescriptor | getFileDescriptor()
Implements org. Returns the corresponding |
| public InetAddress | getInetAddress()
Overrides java. Returns the local address of this server socket. |
| public final int | getLocalPort()
Overrides java. Returns the port number on which this socket is listening. |
| public final @Nullable A | getLocalSocketAddress()
Overrides java. Implements org. Returns the socket's local socket address, or |
| public <T> T | getOption(SocketOption<T>
The socket option name)Overrides java. Returns the value of a socket option. |
| public synchronized int | getReceiveBufferSize()
Overrides java. Gets the value of the |
| public boolean | |
| public int | |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public boolean | Returns: true iff still valid.Checks if the local socket address returned by |
| public static boolean | Returns: true if supported.Checks whether everything is setup to support junixsocket sockets. |
| protected abstract AFServerSocketChannel | |
| protected abstract AFSocketImpl | Returns: The new instance.The file descriptor. fdObj)Creates a new AFSocketImpl. |
| protected static < The concrete A extends AFSocketAddress> AFServerSocketAFSocketAddress that is supported by this type. | Returns: The new instance.The subclass constructor. instanceSupplierCreates a new AFServerSocket instance, using the given subclass constructor. |
| protected static < The concrete A extends AFSocketAddress> AFServerSocketAFSocketAddress that is supported by this type. | Returns: The new instance.The subclass constructor. instanceSupplier,The file descriptor. fdObj, int The local port. localPort, int The remote port. remotePort)Creates a new AFServerSocket instance, using the given subclass constructor. |
| protected abstract AFSocket | |
| public final void | |
| pack-priv final synchronized void | |
| public final void | setDeleteOnClose(boolean
Enabled if b)true.Enables/disables deleting this |
| public <T> ServerSocket | 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.Overrides java. Sets the value of a socket option. |
| public void | setPerformancePreferences(int
An connectionTime, int int expressing the relative importance of a short
connection timeAn latency, int int expressing the relative importance of low
latencyAn bandwidth)int expressing the relative importance of high
bandwidthOverrides java. Sets performance preferences for this ServerSocket. |
| public synchronized void | setReceiveBufferSize(int
the size to which to set the receive buffer
size. This value must be greater than 0. size)Overrides java. Sets a default proposed value for the
|
| public void | setReuseAddress(boolean
whether to enable or disable the socket option on)Overrides java. Enable/disable the |
| public void | setShutdownOnClose(boolean
true if enabled.Implements org. Configures whether the socket should be shutdown upon |
| public void | setSoTimeout(int
the specified timeout, in milliseconds timeout)Overrides java. Enable/disable |
| public Set | supportedOptions()
Overrides java. Returns a set of the socket options supported by this server socket. |
| public String | toString()
Overrides java. Returns the implementation address and implementation port of
this socket as a |
| bindFilter | back to summary |
|---|---|
| private @Nullable SocketAddressFilter bindFilter | |
| boundEndpoint | back to summary |
|---|---|
| private @Nullable A boundEndpoint | |
| channel | back to summary |
|---|---|
private final AFServerSocketChannel<A> channel
| |
| closeables | back to summary |
|---|---|
| private final Closeables closeables | |
| closed | back to summary |
|---|---|
| private final AtomicBoolean closed Hides java. | |
| created | back to summary |
|---|---|
| private final AtomicBoolean created | |
| deleteOnClose | back to summary |
|---|---|
| private final AtomicBoolean deleteOnClose | |
| implementation | back to summary |
|---|---|
| private final AFSocketImpl<A> implementation | |
| AFServerSocket | back to summary |
|---|---|
| protected AFServerSocket() throws IOException Constructs a new, unconnected instance.
| |
| AFServerSocket | back to summary |
|---|---|
| protected AFServerSocket(FileDescriptor fdObj) throws IOException Constructs a new instance, optionally associated with the given file descriptor.
| |
| accept | back to summary |
|---|---|
| public AFSocket Overrides java. Doc from java. Listens for a connection to be made to this socket and accepts it. The method blocks until a connection is made. This method is interruptible in the following circumstances:
| |
| accept1 | back to summary |
|---|---|
| pack-priv AFSocket | |
| addCloseable | back to summary |
|---|---|
| public final void addCloseable(Closeable closeable) Registers a
| |
| addressFamily | back to summary |
|---|---|
| protected final AFAddressFamily Returns the address family supported by this implementation.
| |
| bind | back to summary |
|---|---|
| public final void bind(SocketAddress endpoint) throws IOException Overrides java. Doc from java. Binds the
If the address is
| |
| bind | back to summary |
|---|---|
| public final void bind(SocketAddress endpoint, int backlog) throws IOException Overrides java. Doc from java. Binds the
If the address is
The
| |
| bindHook | back to summary |
|---|---|
| public final AFServerSocket Sets the hook for any subsequent call to
| |
| bindOn | back to summary |
|---|---|
| protected static <A extends AFSocketAddress> AFServerSocket Returns a new
| |
| bindOn | back to summary |
|---|---|
| protected static <A extends AFSocketAddress> AFServerSocket Returns a new
| |
| boundEndpoint0 | back to summary |
|---|---|
| private synchronized @Nullable A boundEndpoint0() | |
| close | back to summary |
|---|---|
| public void close() throws IOException 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
| |
| forceBindAddress | back to summary |
|---|---|
| public final AFServerSocket Forces the address to be used for any subsequent call to
| |
| forceBindOn | back to summary |
|---|---|
| protected static <A extends AFSocketAddress> AFServerSocket Returns a new, unbound
| |
| getAFImpl | back to summary |
|---|---|
| pack-priv final AFSocketImpl | |
| getChannel | back to summary |
|---|---|
| public AFServerSocketChannel Overrides java. Doc from java. Returns the unique A server 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
| |
| getInetAddress | back to summary |
|---|---|
| public InetAddress getInetAddress() Overrides java. Doc from java. Returns the local address of this server socket.
If the socket was bound prior to being
| |
| getLocalPort | back to summary |
|---|---|
| public final int getLocalPort() Overrides java. Doc from java. Returns the port number on which this socket is listening.
If the socket was bound prior to being
| |
| 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(SocketOption<T> name) throws IOException Overrides java. Doc from java. Returns the value of a socket option.
| |
| getReceiveBufferSize | back to summary |
|---|---|
| public synchronized int getReceiveBufferSize() throws SocketException Overrides java. Doc from java. Gets the value of the Note, the value actually set in the accepted socket is determined by
calling
| |
| getReuseAddress | back to summary |
|---|---|
| public boolean getReuseAddress() throws SocketException Overrides java. Doc from java. Tests if
| |
| getSoTimeout | back to summary |
|---|---|
| public int getSoTimeout() throws IOException Overrides java. Doc from java. Retrieve setting for
| |
| isBound | back to summary |
|---|---|
| public final boolean isBound() Overrides java. Doc from java. Returns the binding state of the ServerSocket.
If the socket was bound prior to being closed,
then this method will continue to return
| |
| isClosed | back to summary |
|---|---|
| public final boolean isClosed() Overrides java. Doc from java. Returns the closed state of the ServerSocket.
| |
| isDeleteOnClose | back to summary |
|---|---|
| public final boolean isDeleteOnClose() Checks if this
| |
| isLocalSocketAddressValid | back to summary |
|---|---|
| public boolean isLocalSocketAddressValid() Checks if the local socket address returned by
| |
| isSupported | back to summary |
|---|---|
| public static boolean isSupported() Checks whether everything is setup to support junixsocket sockets.
| |
| newChannel | back to summary |
|---|---|
| protected abstract AFServerSocketChannel Creates a new AFServerSocketChannel for this socket.
| |
| newImpl | back to summary |
|---|---|
| protected abstract AFSocketImpl Creates a new AFSocketImpl.
| |
| newInstance | back to summary |
|---|---|
| protected static <A extends AFSocketAddress> AFServerSocket Creates a new AFServerSocket instance, using the given subclass constructor.
| |
| newInstance | back to summary |
|---|---|
| protected static <A extends AFSocketAddress> AFServerSocket Creates a new AFServerSocket instance, using the given subclass constructor.
| |
| newSocketInstance | back to summary |
|---|---|
| protected abstract AFSocket Returns a new
| |
| removeCloseable | back to summary |
|---|---|
| public final void removeCloseable(Closeable closeable) Unregisters a previously registered
| |
| setBoundEndpoint | back to summary |
|---|---|
| pack-priv final synchronized void setBoundEndpoint(@Nullable A addr) | |
| setDeleteOnClose | back to summary |
|---|---|
| public final void setDeleteOnClose(boolean b) Enables/disables deleting this
| |
| setOption | back to summary |
|---|---|
| public <T> ServerSocket setOption(SocketOption<T> name, T value) throws IOException Overrides java. Doc from java. Sets the value of a socket option.
| |
| setPerformancePreferences | back to summary |
|---|---|
| public void setPerformancePreferences(int connectionTime, int latency, int bandwidth) Overrides java. Doc from java. Sets performance preferences for this ServerSocket. Sockets use the TCP/IP protocol by default. Some implementations may offer alternative protocols which have different performance characteristics than TCP/IP. This method allows the application to express its own preferences as to how these tradeoffs should be made when the implementation chooses from the available protocols. Performance preferences are described by three integers
whose values indicate the relative importance of short connection time,
low latency, and high bandwidth. The absolute values of the integers
are irrelevant; in order to choose a protocol the values are simply
compared, with larger values indicating stronger preferences. If the
application prefers short connection time over both low latency and high
bandwidth, for example, then it could invoke this method with the values
Invoking this method after this socket has been bound will have no effect. This implies that in order to use this capability requires the socket to be created with the no-argument constructor.
| |
| setReceiveBufferSize | back to summary |
|---|---|
| public synchronized void setReceiveBufferSize(int size) throws SocketException Overrides java. Doc from java. Sets a default proposed value for the
The value of
It is possible to change the value subsequently, by calling
Failure to do this will not cause an error, and the buffer size may be set to the requested value but the TCP receive window in sockets accepted from this ServerSocket will be no larger than 64K bytes.
| |
| setReuseAddress | back to summary |
|---|---|
| public void setReuseAddress(boolean on) throws SocketException Overrides java. Doc from java. Enable/disable the
When a TCP connection is closed the connection may remain
in a timeout state for a period of time after the connection
is closed (typically known as the
Enabling
When a
The behaviour when
| |
| setShutdownOnClose | back to summary |
|---|---|
| public void setShutdownOnClose(boolean enabled) Implements org. Doc from org. Configures whether the socket should be shutdown upon
| |
| setSoTimeout | back to summary |
|---|---|
| public void setSoTimeout(int timeout) throws SocketException Overrides java. Doc from java. Enable/disable
| |
| supportedOptions | back to summary |
|---|---|
| public Set Overrides java. Doc from java. Returns a set of the socket options supported by this server socket. This method will continue to return the set of options even after the socket has been closed.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns the implementation address and implementation port of
this socket as a | |
AFSocketAddress that is supported by this type.
| Modifier and Type | Method and Description |
|---|---|
| public @NonNull AFServerSocket | Returns: The new instance.The file descriptor. fd)Creates a new |
| newInstance | back to summary |
|---|---|
| public @NonNull AFServerSocket Creates a new
| |