Exemplo n.º 1
0
        public static IClient Connect(URL url, params IChannelHandler[] handlers)
        {
            if (url == null)
            {
                throw new ArgumentNullException("url == null");
            }
            IChannelHandler handler;

            if (handlers == null || handlers.Length == 0)
            {
                handler = new ChannelHandlerAdapter();
            }
            else if (handlers.Length == 1)
            {
                handler = handlers[0];
            }
            else
            {
                handler = new ChannelHandlerDispatcher(handlers);
            }
            return(GetTransporters().Connected(url, handler));
        }
Exemplo n.º 2
0
        public static IServer Bind(URL url, params IChannelHandler[] handlers)
        {
            if (url == null)
            {
                throw new ArgumentNullException("url");
            }
            if (handlers == null || handlers.Length == 0)
            {
                throw new ArgumentNullException("handlers");
            }
            IChannelHandler handler;

            if (handlers.Length == 1)
            {
                handler = handlers[0];
            }
            else
            {
                handler = new ChannelHandlerDispatcher(handlers);
            }
            return(GetTransporters().Bind(url, handler));
        }
Exemplo n.º 3
0
 public ExchangeHandlerDispatcher(IReplier replier, params IChannelHandler[] handlers)
 {
     _replierDispatcher = new ReplierDispatcher(replier);
     _handlerDispatcher = new ChannelHandlerDispatcher(handlers);
     _telnetHandler     = new TelnetHandlerAdapter();
 }
Exemplo n.º 4
0
 public ExchangeHandlerDispatcher()
 {
     _replierDispatcher = new ReplierDispatcher();
     _handlerDispatcher = new ChannelHandlerDispatcher();
     _telnetHandler     = new TelnetHandlerAdapter();
 }