Ejemplo n.º 1
0
 public IFABChannelGroup Flush(IFABChannelMatcher matcher)
 {
     foreach (IFABChannel c in this.nonServerChannels.Values)
     {
         if (matcher.Matches(c))
         {
             c.Flush();
         }
     }
     return(this);
 }
Ejemplo n.º 2
0
        public Task NewCloseFuture(IFABChannelMatcher matcher)
        {
            Contract.Requires(matcher != null);
            var futures = new Dictionary <IFABChannel, Task>();

            foreach (IFABChannel c in this.nonServerChannels.Values)
            {
                if (matcher.Matches(c))
                {
                    futures.Add(c, c.CloseCompletion);
                }
            }
            foreach (IFABChannel c in this.serverChannels.Values)
            {
                if (matcher.Matches(c))
                {
                    futures.Add(c, c.CloseCompletion);
                }
            }

            return(new FABChannelGroupCompletionSource(this, futures /*, this.executor*/).Task);
        }
Ejemplo n.º 3
0
        public Task WriteAsync(FABMessage message, IFABChannelMatcher matcher)
        {
            Contract.Requires(message != null);
            Contract.Requires(matcher != null);
            var futures = new Dictionary <IFABChannel, Task>();

            foreach (FABChannel c in this.nonServerChannels.Values)
            {
                if (matcher.Matches(c))
                {
                    futures.Add(c, c.WriteAsync(SafeDuplicate(message)));
                }
            }

            ReferenceCountUtil.Release(message);
            return(new FABChannelGroupCompletionSource(this, futures /*, this.executor*/).Task);
        }