java.lang.Object
org.newsclub.net.unix.server.SocketServer<SocketAddress,Socket,ServerSocket>
org.newsclub.net.unix.server.AFUNIXSocketServer
@Deprecated
public abstract class AFUNIXSocketServer
extends SocketServer<SocketAddress,Socket,ServerSocket>
Deprecated.
A base implementation for a simple, multi-threaded socket server.
This class supports both AF_UNIX and "regular" sockets.
- Author:
- Christian Kohlschütter
-
Constructor Summary
ConstructorDescriptionAFUNIXSocketServer
(ServerSocket serverSocket) Deprecated.Creates a server using the given, boundServerSocket
.AFUNIXSocketServer
(SocketAddress listenAddress) Deprecated.Creates a server using the givenSocketAddress
. -
Method Summary
Modifier and TypeMethodDescriptionprotected ServerSocket
Deprecated.Returns a new server socket.boolean
startAndWait
(long duration, TimeUnit unit) Deprecated.Methods inherited from class org.newsclub.net.unix.server.SocketServer
doServeSocket, doSocketClose, getListenAddress, getMaxConcurrentConnections, getServerBusyTimeout, getServerTimeout, getSocketTimeout, isReady, isRunning, onAfterServingSocket, onBeforeServingSocket, onListenException, onListenException, onServerBound, onServerBusy, onServerReady, onServerShuttingDown, onServerStarting, onServerStopped, onServingException, onServingException, onSocketExceptionAfterAccept, onSocketExceptionDuringAccept, onSubmitted, setMaxConcurrentConnections, setServerBusyTimeout, setServerTimeout, setSocketTimeout, start, startAndWaitToBecomeReady, startAndWaitToBecomeReady, startThenStopAfter, stop
-
Constructor Details
-
AFUNIXSocketServer
Deprecated.Creates a server using the given, boundServerSocket
.- Parameters:
serverSocket
- The server socket to use (must be bound).
-
AFUNIXSocketServer
Deprecated.Creates a server using the givenSocketAddress
.- Parameters:
listenAddress
- The address to bind the socket on.
-
-
Method Details
-
startAndWait
Deprecated.Starts the server and waits until it is ready or had to shop due to an error.- Parameters:
duration
- The duration wait.unit
- The duration's time unit.- Returns:
true
if the server is ready to serve requests.- Throws:
InterruptedException
- If the wait was interrupted.- See Also:
-
newServerSocket
Deprecated.Description copied from class:SocketServer
Returns a new server socket.- Specified by:
newServerSocket
in classSocketServer<SocketAddress,
Socket, ServerSocket> - Returns:
- The new socket (an
AFServerSocket
if the listen address is anAFSocketAddress
). - Throws:
IOException
- on error.
-
SocketServer
orAFSocketServer