Exemplo n.º 1
0
        /// <summary>
        ///     Wait for a response
        /// </summary>
        /// <returns>MpdResponse</returns>
        private async Task <MpdResponse> ReadResponseAsync()
        {
            var result = new MpdResponse();

            using (var reader = new StreamReader(_networkStream, Encoding.UTF8, true, 512, true))
            {
                string line;
                do
                {
                    line = await reader.ReadLineAsync().ConfigureAwait(false);
                } while (!result.AddLine(line));
                if (Log.IsVerboseEnabled())
                {
                    Log.Verbose().WriteLine("Received answer: {0}", string.Join(Environment.NewLine, result.ResponseLines));
                }
            }
            return(result);
        }
Exemplo n.º 2
0
		/// <summary>
		///     Wait for a response
		/// </summary>
		/// <returns>MpdResponse</returns>
		private async Task<MpdResponse> ReadResponseAsync()
		{
			var result = new MpdResponse();
			using (var reader = new StreamReader(_networkStream, Encoding.UTF8, true, 512, true))
			{
				string line;
				do
				{
					line = await reader.ReadLineAsync().ConfigureAwait(false);
				} while (!result.AddLine(line));
				if (Log.IsVerboseEnabled())
				{
					Log.Verbose().WriteLine("Received answer: {0}", string.Join(Environment.NewLine, result.ResponseLines));
				}
			}
			return result;
		}