public void run() { sock.handleException((Exception) t); ch.close(); } });
public void run() { pool.connectionClosed(); ch.close(); } });
private void failed(NioSocketChannel ch, final Throwable t) { ch.close(); if (t instanceof Exception && exceptionHandler != null) { tcpHelper.runOnCorrectThread(ch, new Runnable() { public void run() { vertx.setContext(ctx); exceptionHandler.handle((Exception) t); } }); } else { log.error("Unhandled exception", t); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { final NioSocketChannel ch = (NioSocketChannel) e.getChannel(); final ServerConnection conn = connectionMap.get(ch); final Throwable t = e.getCause(); ch.close(); if (conn != null && t instanceof Exception) { conn.getContext().execute(new Runnable() { public void run() { conn.handleException((Exception) t); } }); } else { // Ignore - any exceptions not associated with any sock (e.g. failure in ssl handshake) will // be communicated explicitly } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) { final NioSocketChannel ch = (NioSocketChannel) e.getChannel(); final NetSocket sock = socketMap.remove(ch); ch.close(); final Throwable t = e.getCause(); log.error("Exception on netserver", t); if (sock != null && t instanceof Exception) { sock.getContext().execute(new Runnable() { public void run() { sock.handleException((Exception) t); } }); } else { // Ignore - any exceptions not associated with any sock (e.g. failure in ssl handshake) will // be communicated explicitly } } }