public LocalServerChannel() { _inboundBuffer = PlatformDependent.NewMpscQueue <object>(); _shutdownHook = () => Unsafe.Close(Unsafe.VoidPromise()); var config = new DefaultChannelConfiguration(this); config.Allocator = new PreferHeapByteBufAllocator(config.Allocator); Configuration = config; }
void TryClose(bool isActive) { if (isActive) { Unsafe.Close(Unsafe.VoidPromise()); } else { ReleaseInboundBuffers(); } }
internal LocalChannel(LocalServerChannel parent, LocalChannel peer) : base(parent) { _inboundBuffer = PlatformDependent.NewMpscQueue <object>(); v_peer = peer; if (parent is object) { v_localAddress = parent.LocalAddress; } if (peer is object) { v_remoteAddress = peer.LocalAddress; } var config = new DefaultChannelConfiguration(this); config.Allocator = new PreferHeapByteBufAllocator(config.Allocator); Configuration = config; shutdownHook = () => Unsafe.Close(Unsafe.VoidPromise()); }