/** * This creates a new background task that will listen to the * specified <code>ServerAddress</code> for incoming TCP connect * requests. When an connection is accepted it is handed to the * internal socket connector. * * @param address this is the address used to accept connections * @param context this is used for secure SSL connections * * @return this returns the actual local address that is used */ public SocketAddress listen(SocketAddress address, SSLContext context) throws IOException { SocketListener listener = new SocketListener(address, processor, analyzer, context); if(processor != null) { listener.process(); listeners.add(listener); } return listener.getAddress(); }
/** * This creates a new background task that will listen to the * specified <code>ServerAddress</code> for incoming TCP connect * requests. When an connection is accepted it is handed to the * internal socket connector. * * @param address this is the address used to accept connections * @param context this is used for secure SSL connections * * @return this returns the actual local address that is used */ public SocketAddress listen(SocketAddress address, SSLContext context) throws IOException { SocketListener listener = new SocketListener(address, processor, analyzer, context); if(processor != null) { listener.process(); listeners.add(listener); } return listener.getAddress(); }
/** * This creates a new background task that will listen to the * specified <code>ServerAddress</code> for incoming TCP connect * requests. When an connection is accepted it is handed to the * internal <code>Server</code> implementation as a pipeline. The * background task is a non daemon task to ensure the server is * kept active, to terminate the connection this can be closed. * * @param address this is the address used to accept connections * @param context this is used for secure SSL connections * * @return this returns the actual local address that is used */ public SocketAddress listen(SocketAddress address, SSLContext context) throws IOException { SocketListener listener = new SocketListener(address, context, server, agent); if(server != null) { add(listener); } return listener.getAddress(); }