コード例 #1
0
ファイル: LocalServerChannel.cs プロジェクト: wxlonstar/Fenix
        public LocalServerChannel()
        {
            _inboundBuffer = PlatformDependent.NewMpscQueue <object>();
            _shutdownHook  = () => Unsafe.Close(Unsafe.VoidPromise());

            var config = new DefaultChannelConfiguration(this);

            config.Allocator = new PreferHeapByteBufAllocator(config.Allocator);
            Configuration    = config;
        }
コード例 #2
0
ファイル: LocalChannel.cs プロジェクト: ywscr/SpanNetty
 void TryClose(bool isActive)
 {
     if (isActive)
     {
         Unsafe.Close(Unsafe.VoidPromise());
     }
     else
     {
         ReleaseInboundBuffers();
     }
 }
コード例 #3
0
ファイル: LocalChannel.cs プロジェクト: ywscr/SpanNetty
        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());
        }