Esempio n. 1
0
 public ReplierDispatcher(IReplier defaultReplier = null, ConcurrentDictionary <Type, IReplier> repliers = null)
 {
     this._defaultReplier = defaultReplier;
     if (repliers != null && repliers.Count > 0)
     {
         foreach (var replier in repliers)
         {
             _repliers.TryAdd(replier.Key, replier.Value);
         }
     }
 }
Esempio n. 2
0
 public ExchangeHandlerDispatcher AddReplier(Type type, IReplier replier)
 {
     _replierDispatcher.AddReplier(type, replier);
     return(this);
 }
Esempio n. 3
0
 public ExchangeHandlerDispatcher(IReplier replier, params IChannelHandler[] handlers)
 {
     _replierDispatcher = new ReplierDispatcher(replier);
     _handlerDispatcher = new ChannelHandlerDispatcher(handlers);
     _telnetHandler     = new TelnetHandlerAdapter();
 }
Esempio n. 4
0
 public static Task <IExchangeClient> ConnectAsync(URL url, IChannelHandler handler, IReplier replier)
 {
     return(ConnectAsync(url, new ExchangeHandlerDispatcher(replier, handler)));
 }
Esempio n. 5
0
 public static Task <IExchangeClient> ConnectAsync(string url, IChannelHandler handler, IReplier replier)
 {
     return(ConnectAsync(URL.ValueOf(url), handler, replier));
 }
Esempio n. 6
0
 public static Task <IExchangeClient> ConnectAsync(URL url, IReplier replier)
 {
     return(ConnectAsync(url, new ChannelHandlerAdapter(), replier));
 }
Esempio n. 7
0
 public static Task <IExchangeServer> BindAsync(URL url, IChannelHandler handler, IReplier replier)
 {
     return(BindAsync(url, new ExchangeHandlerDispatcher(replier, handler)));
 }
Esempio n. 8
0
 public static Task <IExchangeServer> BindAsync(string url, IChannelHandler handler, IReplier replier)
 {
     return(BindAsync(URL.ValueOf(url), handler, replier));
 }
Esempio n. 9
0
 public static Task <IExchangeServer> BindAsync(URL url, IReplier replier)
 {
     return(BindAsync(url, new ChannelHandlerAdapter(), replier));
 }
Esempio n. 10
0
 public ReplierDispatcher AddReplier(Type type, IReplier replier)
 {
     _repliers.TryAdd(type, replier);
     return(this);
 }