/** * Constructor for the <code>ConnectionException</code> object. This * is used to represent an exception that is thrown when an error * occurs during the connect process. Typically this is thrown if * there is a problem connecting or accepting from a socket. * * @param message this is the message describing the exception * @param cause this is the cause of the producer exception */ public ConnectionException(String message, Throwable cause) { super(message); initCause(cause); } }
/** * This is used to register the <code>Acceptor</code> 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. * * @throws IOException thrown if there is a problem registering */ private void process() throws IOException { try { reactor.process(acceptor, OP_ACCEPT); } catch(Exception cause) { throw new ConnectionException("Listen error", cause); } }
/** * 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 * * @return this returns the actual local address that is used */ public SocketAddress connect(SocketAddress address) throws IOException { if(closed) { throw new ConnectionException("Connection is closed"); } return manager.listen(address); }
/** * 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 * * @return this returns the actual local address that is used */ public SocketAddress connect(SocketAddress address) throws IOException { if(closed) { throw new ConnectionException("Connection is closed"); } return manager.listen(address); }
/** * Constructor for the <code>ConnectionException</code> object. This * is used to represent an exception that is thrown when an error * occurs during the connect process. Typically this is thrown if * there is a problem connecting or accepting from a socket. * * @param message this is the message describing the exception * @param cause this is the cause of the producer exception */ public ConnectionException(String message, Throwable cause) { super(message); initCause(cause); } }
/** * 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 connect(SocketAddress address, SSLContext context) throws IOException { if(closed) { throw new ConnectionException("Connection is closed"); } return manager.listen(address, context); }
/** * Constructor for the <code>ConnectionException</code> object. This * is used to represent an exception that is thrown when an error * occurs during the connect process. Typically this is thrown if * there is a problem connecting or accepting from a socket. * * @param message this is the message describing the exception * @param cause this is the cause of the producer exception */ public ConnectionException(String message, Throwable cause) { super(message); initCause(cause); } }
/** * 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 connect(SocketAddress address, SSLContext context) throws IOException { if(closed) { throw new ConnectionException("Connection is closed"); } return manager.listen(address, context); }
/** * 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 * * @return this returns the actual local address that is used */ public SocketAddress connect(SocketAddress address) throws IOException { if(closed) { throw new ConnectionException("Connection is closed"); } return manager.listen(address); }
/** * 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 connect(SocketAddress address, SSLContext context) throws IOException { if(closed) { throw new ConnectionException("Connection is closed"); } return manager.listen(address, context); }
/** * 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); } }
/** * This is used to close the connection and the server socket * used to accept connections. This will perform a close of the * connected server socket and the dispatching thread. */ public void close() throws IOException { try { acceptor.close(); reactor.stop(); } catch(Exception cause) { throw new ConnectionException("Close error", cause); } } }
/** * This is used to close the connection and the server socket * used to accept connections. This will perform a close of the * connected server socket and the dispatching thread. */ public void close() throws IOException { try { acceptor.close(); reactor.stop(); } catch(Exception cause) { throw new ConnectionException("Close error", cause); } } }
/** * This is used to close the connection and the server socket * used to accept connections. This will perform a close of the * connected server socket that have been created from using * the <code>Acceptor</code> object. * * @throws IOException thrown if there is a problem closing */ public void close() throws IOException { try { acceptor.close(); reactor.stop(); } catch(Exception cause) { throw new ConnectionException("Close error", cause); } } }