System.Net.WebConnectionStream.Read C# (CSharp) Method

Read() public method

public Read ( byte buffer, int offset, int size ) : int
buffer byte
offset int
size int
return int
		public override int Read (byte [] buffer, int offset, int size)
		{
			AsyncCallback cb = cb_wrapper;
			WebAsyncResult res = (WebAsyncResult) BeginRead (buffer, offset, size, cb, null);
			if (!res.IsCompleted && !res.WaitUntilComplete (ReadTimeout, false)) {
				nextReadCalled = true;
				cnc.Close (true);
				throw new WebException ("The operation has timed out.", WebExceptionStatus.Timeout);
			}

			return EndRead (res);
		}