Class AFSocketServer<A extends org.newsclub.net.unix.AFSocketAddress>

java.lang.Object
org.newsclub.net.unix.server.SocketServer<A,org.newsclub.net.unix.AFSocket<? extends A>,org.newsclub.net.unix.AFServerSocket<? extends A>>
org.newsclub.net.unix.server.AFSocketServer<A>
Type Parameters:
A - The supported address type.

public abstract class AFSocketServer<A extends org.newsclub.net.unix.AFSocketAddress> extends SocketServer<A,org.newsclub.net.unix.AFSocket<? extends A>,org.newsclub.net.unix.AFServerSocket<? extends A>>
A base implementation for a simple, multi-threaded socket server using AFSockets.
Author:
Christian Kohlschütter
  • Constructor Details

    • AFSocketServer

      public AFSocketServer(org.newsclub.net.unix.AFServerSocket<? extends A> serverSocket)
      Creates a server using the given, bound ServerSocket.
      Parameters:
      serverSocket - The server socket to use (must be bound).
    • AFSocketServer

      public AFSocketServer(A listenAddress)
      Creates a server using the given SocketAddress.
      Parameters:
      listenAddress - The address to bind the socket on.
  • Method Details

    • newServerSocket

      protected org.newsclub.net.unix.AFServerSocket<A> newServerSocket() throws IOException
      Description copied from class: SocketServer
      Returns a new server socket.
      Specified by:
      newServerSocket in class SocketServer<A extends org.newsclub.net.unix.AFSocketAddress,org.newsclub.net.unix.AFSocket<? extends A extends org.newsclub.net.unix.AFSocketAddress>,org.newsclub.net.unix.AFServerSocket<? extends A extends org.newsclub.net.unix.AFSocketAddress>>
      Returns:
      The new socket (an AFServerSocket if the listen address is an AFSocketAddress).
      Throws:
      IOException - on error.