public ShellViewModel()
        {
            //��ȡ�¼��ۺ���
            _aggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
            _clientListService = ServiceLocator.Current.GetInstance<IClientListService>();

            if (DesignerProperties.GetIsInDesignMode(new DependencyObject()))
            {
                // Code runs in Blend --> create design time data.
            }
            else
            {
                //��ȡSocket
                _acceptor = ServiceLocator.Current.GetInstance<IoAcceptor>();
            }
        }
        public ClientsTreeViewModel()
        {
            _aggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
            _clientListService= ServiceLocator.Current.GetInstance<IClientListService>();

            if (DesignerProperties.GetIsInDesignMode(new DependencyObject()))
            {
                // Code runs in Blend --> create design time data.
            }
            else
            {
                //获取Socket
                _acceptor = ServiceLocator.Current.GetInstance<IoAcceptor>();
            }
            _aggregator.GetEvent<SpecifyAnAppDefinitionItemToSelectEvent>().Subscribe(i =>
            {
                SelectedItem = i;
            });
        }
 public void SetUp()
 {
     result = "";
     acceptor = new AsyncDatagramAcceptor();
     connector = new AsyncDatagramConnector();
 }
 public AbstractTrafficControlTest(IoAcceptor acceptor)
 {
     this.acceptor = acceptor;
 }
        /// <summary>
        /// MinaListener
        /// </summary>
        void StartMinaListener()
        {
            if (Acceptor != null)
                throw new Exception("This should not happen!");

            Acceptor = new AsyncSocketAcceptor();
            Acceptor.FilterChain.AddLast("logger", new LoggingFilter());
            Acceptor.FilterChain.AddLast("codec", new ProtocolCodecFilter(new TextLineCodecFactory(Encoding.UTF8)));

            Acceptor.ExceptionCaught += HandleException;
            Acceptor.SessionOpened += HandeleSessionOpened;
            Acceptor.SessionClosed += HandeleSessionClosed;
            Acceptor.SessionIdle += HandleIdle;
            Acceptor.MessageReceived += HandleReceived;

            Acceptor.SessionConfig.ReadBufferSize = 10*1024;
            Acceptor.SessionConfig.SetIdleTime(IdleStatus.BothIdle, 10);

            Acceptor.Bind(new IPEndPoint(IPAddress.Any, _port));
        }
 public AbstractBindTest(IoAcceptor acceptor)
 {
     this.acceptor = acceptor;
 }