public async void Listen() { try { _tcpListener?.Start(); while (true) { var tcpClient = _tcpListener?.AcceptTcpClient(); var interaction = new ClientProtocol(tcpClient); interaction.ExcecuteCommand = ReadCommand; await interaction.StartAsync(); } } catch (Exception ex) { _logger.LogError($"{ex}"); } finally { _tcpListener?.Stop(); } }