Пример #1
0
        private Future <Void> Write(object msg, bool flush)
        {
            if (_disposed)
            {
                throw new System.InvalidOperationException("sending on disposed channel");
            }

            if (_channel.Active)
            {
                if (flush)
                {
                    return(_channel.writeAndFlush(msg));
                }
                else
                {
                    return(_channel.write(msg));
                }
            }
            else
            {
                Promise <Void> promise = _eventLoop.newPromise();
                System.Action <io.netty.channel.Channel, object> writer;

                if (flush)
                {
                    writer = (_channel, message) => chain(_channel.writeAndFlush(msg), promise);
                }
                else
                {
                    writer = (_channel, message) => chain(_channel.write(msg), promise);
                }

                DeferredWrite(msg, _fChannel, promise, true, writer);
                return(promise);
            }
        }
Пример #2
0
 public override Future <Void> Write(object msg)
 {
     CheckDisposed();
     return(_channel.write(msg));
 }