/** * Constructor for the <code>SocketAcceptor</code> object. This * accepts new TCP connections from the specified server socket. * Each of the connections that is accepted is configured for * performance for HTTP applications. * * @param address this is the address to accept connections from * @param context this is the SSL context used for secure HTTPS * @param server this is used to initiate the HTTP processing * @param agent this is the tracing agent associated with this */ public SocketAcceptor(SocketAddress address, SSLContext context, Server server, Agent agent) throws IOException { this.listener = ServerSocketChannel.open(); this.socket = listener.socket(); this.context = context; this.agent = agent; this.server = server; this.bind(address); }
/** * This is used to register the socket acceptor to listen for * new connections that are ready to be accepted. Once this is * registered it will remain registered until the interface is * closed, at which point the socket is closed. */ public void process() throws IOException { try { acceptor.bind(); reactor.process(acceptor, OP_ACCEPT); } catch(Exception cause) { throw new ConnectionException("Listen error", cause); } }
/** * This is used to register the socket acceptor to listen for * new connections that are ready to be accepted. Once this is * registered it will remain registered until the interface is * closed, at which point the socket is closed. */ public void process() throws IOException { try { acceptor.bind(); reactor.process(acceptor, OP_ACCEPT); } catch(Exception cause) { throw new ConnectionException("Listen error", cause); } }