public Task BindAsync(EndPoint localAddress)
        {
            Contract.Requires(localAddress != null);
            // todo: check for cancellation
            //if (!validatePromise(ctx, promise, false)) {
            //    // promise cancelled
            //    return;
            //}

            AbstractChannelHandlerContext next = this.FindContextOutbound();
            IEventExecutor nextExecutor        = next.Executor;

            return(nextExecutor.InEventLoop
                ? next.InvokeBindAsync(localAddress)
                : SafeExecuteOutboundAsync(nextExecutor, () => next.InvokeBindAsync(localAddress)));
        }
Esempio n. 2
0
 public void Run()
 {
     _ctx.InvokeBindAsync(_localAddress).LinkOutcome(_promise);
 }