Refine search
private void readInbound() { RecvByteBufAllocator.Handle handle = unsafe().recvBufAllocHandle(); handle.reset(config()); ChannelPipeline pipeline = pipeline(); do { Object m = inboundBuffer.poll(); if (m == null) { break; } pipeline.fireChannelRead(m); } while (handle.continueReading()); pipeline.fireChannelReadComplete(); }
LocalChannel serve(final LocalChannel peer) { final LocalChannel child = newLocalChannel(peer); if (eventLoop().inEventLoop()) { serve0(child); } else { eventLoop().execute(new Runnable() { @Override public void run() { serve0(child); } }); } return child; }
private void serve0(final LocalChannel child) { inboundBuffer.add(child); if (acceptInProgress) { acceptInProgress = false; readInbound(); } } }
Exception cause = new AlreadyConnectedException(); safeSetFailure(promise, cause); pipeline().fireExceptionCaught(cause); return; peer = serverChannel.serve(LocalChannel.this);
private void serve0(final LocalChannel child) { inboundBuffer.add(child); if (acceptInProgress) { acceptInProgress = false; ChannelPipeline pipeline = pipeline(); for (;;) { Object m = inboundBuffer.poll(); if (m == null) { break; } pipeline.fireChannelRead(m); } pipeline.fireChannelReadComplete(); } } }
@Override protected void doRegister() throws Exception { ((SingleThreadEventExecutor) eventLoop()).addShutdownHook(shutdownHook); }
@Override protected void doDeregister() throws Exception { ((SingleThreadEventExecutor) eventLoop()).removeShutdownHook(shutdownHook); }
state = State.CONNECTED; peer.remoteAddress = parent() == null ? null : parent().localAddress(); peer.state = State.CONNECTED; ((SingleThreadEventExecutor) eventLoop()).addShutdownHook(shutdownHook);
protected LocalChannel(LocalServerChannel parent, LocalChannel peer) { super(parent); config().setAllocator(new PreferHeapByteBufAllocator(config.getAllocator())); this.peer = peer; localAddress = parent.localAddress(); remoteAddress = peer.localAddress(); }
public LocalServerChannel() { config().setAllocator(new PreferHeapByteBufAllocator(config.getAllocator())); }
Exception cause = new AlreadyConnectedException(); safeSetFailure(promise, cause); pipeline().fireExceptionCaught(cause); return; peer = serverChannel.serve(LocalChannel.this);
@Override protected void doBeginRead() throws Exception { if (acceptInProgress) { return; } Queue<Object> inboundBuffer = this.inboundBuffer; if (inboundBuffer.isEmpty()) { acceptInProgress = true; return; } ChannelPipeline pipeline = pipeline(); for (;;) { Object m = inboundBuffer.poll(); if (m == null) { break; } pipeline.fireChannelRead(m); } pipeline.fireChannelReadComplete(); }
@Override protected void doRegister() throws Exception { ((SingleThreadEventExecutor) eventLoop()).addShutdownHook(shutdownHook); }
@Override protected void doDeregister() throws Exception { ((SingleThreadEventExecutor) eventLoop()).removeShutdownHook(shutdownHook); }
state = State.CONNECTED; peer.remoteAddress = parent() == null ? null : parent().localAddress(); peer.state = State.CONNECTED; ((SingleThreadEventExecutor) eventLoop()).addShutdownHook(shutdownHook);
protected LocalChannel(LocalServerChannel parent, LocalChannel peer) { super(parent); config().setAllocator(new PreferHeapByteBufAllocator(config.getAllocator())); this.peer = peer; localAddress = parent.localAddress(); remoteAddress = peer.localAddress(); }
public LocalServerChannel() { config().setAllocator(new PreferHeapByteBufAllocator(config.getAllocator())); }
private void readInbound() { RecvByteBufAllocator.Handle handle = unsafe().recvBufAllocHandle(); handle.reset(config()); ChannelPipeline pipeline = pipeline(); do { Object m = inboundBuffer.poll(); if (m == null) { break; } pipeline.fireChannelRead(m); } while (handle.continueReading()); pipeline.fireChannelReadComplete(); }