public Console(WxhtpClient client, WxhtpServiceServer wxhtpServiceServer, CancellationToken ct)
        {
            InitializeComponent();

            _wxhtpClient        = client;
            _wxhtpServiceServer = wxhtpServiceServer;
            _ct             = ct;
            DataContext     = dc;
            Loaded         += MainWindow_Loaded;
            Title           = Title + " " + _wxhtpClient.getTcpClient().Client.RemoteEndPoint.ToString();
            cmdexecListener = new CmdExecListener();
            Closing        += new CancelEventHandler(MainWindow_Closing);
        }
Ejemplo n.º 2
0
        public async Task Run()
        {
            while (!_shouldStop)
            {
                try
                {
                    var tcpClient = await _listener.AcceptTcpClientAsync();

                    var         ipEndPoint = ((IPEndPoint)tcpClient.Client.RemoteEndPoint);
                    WxhtpClient cl         = new WxhtpClient(ref tcpClient, ref _dictionaryWxhtpClients, _viewModel);
                    _dictionaryWxhtpClients.TryAdd(ipEndPoint, cl);
                    _observableSequenceOfConnections.OnNext(ipEndPoint.ToString());
                }
                catch (Exception e)
                {
                    Debug.WriteLine("Exception in Run " + e.Message);
                }
            }
            return;
        }
 public AsyncTaskExecutor(WxhtpClient client)
 {
     this.client = client;
     ObservableSequenceOfResponses = new Subject <Response>();
 }