@Override protected void doBind(SocketAddress localAddress) throws Exception { this.localAddress = LocalChannelRegistry.register(this, this.localAddress, localAddress); state = 1; }
private void finishPeerRead(final LocalChannel peer) { // If the peer is also writing, then we must schedule the event on the event loop to preserve read order. if (peer.eventLoop() == eventLoop() && !peer.writeInProgress) { finishPeerRead0(peer); } else { runFinishPeerReadTask(peer); } }
/** * A factory method for {@link LocalChannel}s. Users may override it * to create custom instances of {@link LocalChannel}s. */ protected LocalChannel newLocalChannel(LocalChannel peer) { return new LocalChannel(this, peer); }
protected LocalChannel(LocalServerChannel parent, LocalChannel peer) { super(parent); config().setAllocator(new PreferHeapByteBufAllocator(config.getAllocator())); this.peer = peer; localAddress = parent.localAddress(); remoteAddress = peer.localAddress(); }
private void tryClose(boolean isActive) { if (isActive) { unsafe().close(unsafe().voidPromise()); } else { releaseInboundBuffers(); } }
@Override protected void doClose() throws Exception { if (state <= 1) { // Update all internal state before the closeFuture is notified. if (localAddress != null) { LocalChannelRegistry.unregister(localAddress); localAddress = null; } state = 2; } }
@Override protected AbstractUnsafe newUnsafe() { return new LocalUnsafe(); }
private void serve0(final LocalChannel child) { inboundBuffer.add(child); if (acceptInProgress) { acceptInProgress = false; readInbound(); } } }
@Override protected void doDisconnect() throws Exception { doClose(); }
@Override protected void doDeregister() throws Exception { // Just remove the shutdownHook as this Channel may be closed later or registered to another EventLoop ((SingleThreadEventExecutor) eventLoop()).removeShutdownHook(shutdownHook); }
private void finishPeerRead(final LocalChannel peer) { // If the peer is also writing, then we must schedule the event on the event loop to preserve read order. if (peer.eventLoop() == eventLoop() && !peer.writeInProgress) { finishPeerRead0(peer); } else { runFinishPeerReadTask(peer); } }
@Override protected void doBind(SocketAddress localAddress) throws Exception { this.localAddress = LocalChannelRegistry.register(this, this.localAddress, localAddress); state = State.BOUND; }
/** * A factory method for {@link LocalChannel}s. Users may override it * to create custom instances of {@link LocalChannel}s. */ protected LocalChannel newLocalChannel(LocalChannel peer) { return new LocalChannel(this, peer); }
@Override protected void doClose() throws Exception { if (state <= 1) { // Update all internal state before the closeFuture is notified. if (localAddress != null) { LocalChannelRegistry.unregister(localAddress); localAddress = null; } state = 2; } }
@Override protected AbstractUnsafe newUnsafe() { return new LocalUnsafe(); }
@Override protected void doBeginRead() throws Exception { if (acceptInProgress) { return; } Queue<Object> inboundBuffer = this.inboundBuffer; if (inboundBuffer.isEmpty()) { acceptInProgress = true; return; } readInbound(); }
@Override protected void doBind(SocketAddress localAddress) throws Exception { this.localAddress = LocalChannelRegistry.register(this, this.localAddress, localAddress); state = 1; }
@Override protected void doBind(SocketAddress localAddress) throws Exception { this.localAddress = LocalChannelRegistry.register(this, this.localAddress, localAddress); state = State.BOUND; }