Ejemplo 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);
         }
     }
 }
Ejemplo n.º 2
0
 public ExchangeHandlerDispatcher AddReplier(Type type, IReplier replier)
 {
     _replierDispatcher.AddReplier(type, replier);
     return(this);
 }
Ejemplo n.º 3
0
 public ExchangeHandlerDispatcher(IReplier replier, params IChannelHandler[] handlers)
 {
     _replierDispatcher = new ReplierDispatcher(replier);
     _handlerDispatcher = new ChannelHandlerDispatcher(handlers);
     _telnetHandler     = new TelnetHandlerAdapter();
 }
Ejemplo n.º 4
0
 public static Task <IExchangeClient> ConnectAsync(URL url, IChannelHandler handler, IReplier replier)
 {
     return(ConnectAsync(url, new ExchangeHandlerDispatcher(replier, handler)));
 }
Ejemplo n.º 5
0
 public static Task <IExchangeClient> ConnectAsync(string url, IChannelHandler handler, IReplier replier)
 {
     return(ConnectAsync(URL.ValueOf(url), handler, replier));
 }
Ejemplo n.º 6
0
 public static Task <IExchangeClient> ConnectAsync(URL url, IReplier replier)
 {
     return(ConnectAsync(url, new ChannelHandlerAdapter(), replier));
 }
Ejemplo n.º 7
0
 public static Task <IExchangeServer> BindAsync(URL url, IChannelHandler handler, IReplier replier)
 {
     return(BindAsync(url, new ExchangeHandlerDispatcher(replier, handler)));
 }
Ejemplo n.º 8
0
 public static Task <IExchangeServer> BindAsync(string url, IChannelHandler handler, IReplier replier)
 {
     return(BindAsync(URL.ValueOf(url), handler, replier));
 }
Ejemplo n.º 9
0
 public static Task <IExchangeServer> BindAsync(URL url, IReplier replier)
 {
     return(BindAsync(url, new ChannelHandlerAdapter(), replier));
 }
Ejemplo n.º 10
0
 public ReplierDispatcher AddReplier(Type type, IReplier replier)
 {
     _repliers.TryAdd(type, replier);
     return(this);
 }