@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { acceptor.ioService.sessions.remove(id); acceptor.factory.handlerBridge.sessionClosed(handler, NettyIoSession.this); context = null; }
public NettyIoServiceFactoryFactory(EventLoopGroup eventLoopGroup) { this.eventLoopGroup = eventLoopGroup; this.handlerBridge = new NettyIoHandlerBridge(); }
@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { context = ctx; acceptor.channelGroup.add(ctx.channel()); acceptor.ioService.sessions.put(id, NettyIoSession.this); prev = context.newPromise().setSuccess(); remoteAddr = context.channel().remoteAddress(); acceptor.factory.handlerBridge.sessionCreated(handler, NettyIoSession.this); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { ByteBuf buf = (ByteBuf) msg; byte[] bytes = new byte[buf.readableBytes()]; buf.getBytes(0, bytes); acceptor.factory.handlerBridge.messageReceived(handler, NettyIoSession.this, new ByteArrayBuffer(bytes)); }
@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { context = ctx; acceptor.channelGroup.add(ctx.channel()); acceptor.ioService.sessions.put(id, NettyIoSession.this); prev = context.newPromise().setSuccess(); remoteAddr = context.channel().remoteAddress(); acceptor.factory.handlerBridge.sessionCreated(handler, NettyIoSession.this); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { ByteBuf buf = (ByteBuf) msg; byte[] bytes = new byte[buf.readableBytes()]; buf.getBytes(0, bytes); acceptor.factory.handlerBridge.messageReceived(handler, NettyIoSession.this, new ByteArrayBuffer(bytes)); }
@Override public void sessionCreated(IoHandler handler, IoSession session) throws Exception { context.executeFromIO(v -> { try { super.sessionCreated(handler, session); } catch (Exception e) { throw new VertxException(e); } }); }
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { acceptor.ioService.sessions.remove(id); acceptor.factory.handlerBridge.sessionClosed(handler, NettyIoSession.this); context = null; }
@Override public void messageReceived(IoHandler handler, IoSession session, org.apache.sshd.common.util.Readable message) throws Exception { context.executeFromIO(v -> { try { super.messageReceived(handler, session, message); } catch (Exception e) { throw new VertxException(e); } }); } }
public NettyIoServiceFactoryFactory() { this.eventLoopGroup = null; this.handlerBridge = new NettyIoHandlerBridge(); }
@Override public void sessionClosed(IoHandler handler, IoSession session) throws Exception { context.executeFromIO(v -> { try { super.sessionClosed(handler, session); } catch (Exception e) { throw new VertxException(e); } }); }
public NettyIoServiceFactory(EventLoopGroup group) { this(group, new NettyIoHandlerBridge()); }
public NettyIoServiceFactoryFactory() { this.eventLoopGroup = null; this.handlerBridge = new NettyIoHandlerBridge(); }
public NettyIoServiceFactoryFactory(EventLoopGroup eventLoopGroup) { this.eventLoopGroup = eventLoopGroup; this.handlerBridge = new NettyIoHandlerBridge(); }
public NettyIoServiceFactory(EventLoopGroup group) { this(group, new NettyIoHandlerBridge()); }