Example #1
0
        public LocalServerChannel()
        {
            _inboundBuffer = PlatformDependent.NewMpscQueue <object>();
            _shutdownHook  = () => Unsafe.Close(Unsafe.VoidPromise());

            var config = new DefaultChannelConfiguration(this);

            config.Allocator = new PreferHeapByteBufAllocator(config.Allocator);
            Configuration    = config;
        }
Example #2
0
 void TryClose(bool isActive)
 {
     if (isActive)
     {
         Unsafe.Close(Unsafe.VoidPromise());
     }
     else
     {
         ReleaseInboundBuffers();
     }
 }
Example #3
0
        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());
        }