public Task InvokeBindAsync( IChannelHandlerContext ctx, EndPoint localAddress) { Contract.Requires(localAddress != null); // todo: check for cancellation //if (!validatePromise(ctx, promise, false)) { // // promise cancelled // return; //} if (this.executor.InEventLoop) { return(ChannelHandlerInvokerUtil.InvokeBindAsyncNow(ctx, localAddress)); } else { return(this.SafeExecuteOutboundAsync(() => ChannelHandlerInvokerUtil.InvokeBindAsyncNow(ctx, localAddress))); } }