Files
2026-06-04 11:42:34 +02:00

352 lines
7.2 KiB
C#

using System;
using System.IO;
using System.Threading;
namespace System.Net
{
// Token: 0x0200025E RID: 606
internal class WebAsyncResult : IAsyncResult
{
// Token: 0x06001587 RID: 5511 RVA: 0x00044FEC File Offset: 0x000431EC
public WebAsyncResult(AsyncCallback cb, object state)
{
this.cb = cb;
this.state = state;
}
// Token: 0x06001588 RID: 5512 RVA: 0x00045010 File Offset: 0x00043210
public WebAsyncResult(HttpWebRequest request, AsyncCallback cb, object state)
{
this.cb = cb;
this.state = state;
}
// Token: 0x06001589 RID: 5513 RVA: 0x00045034 File Offset: 0x00043234
public WebAsyncResult(AsyncCallback cb, object state, byte[] buffer, int offset, int size)
{
this.cb = cb;
this.state = state;
this.buffer = buffer;
this.offset = offset;
this.size = size;
}
// Token: 0x0600158A RID: 5514 RVA: 0x00045078 File Offset: 0x00043278
internal void SetCompleted(bool synch, Exception e)
{
this.synch = synch;
this.exc = e;
object obj = this.locker;
lock (obj)
{
this.isCompleted = true;
if (this.handle != null)
{
this.handle.Set();
}
}
}
// Token: 0x0600158B RID: 5515 RVA: 0x000450E8 File Offset: 0x000432E8
internal void Reset()
{
this.callbackDone = false;
this.exc = null;
this.response = null;
this.writeStream = null;
this.exc = null;
object obj = this.locker;
lock (obj)
{
this.isCompleted = false;
if (this.handle != null)
{
this.handle.Reset();
}
}
}
// Token: 0x0600158C RID: 5516 RVA: 0x0004516C File Offset: 0x0004336C
internal void SetCompleted(bool synch, int nbytes)
{
this.synch = synch;
this.nbytes = nbytes;
this.exc = null;
object obj = this.locker;
lock (obj)
{
this.isCompleted = true;
if (this.handle != null)
{
this.handle.Set();
}
}
}
// Token: 0x0600158D RID: 5517 RVA: 0x000451E4 File Offset: 0x000433E4
internal void SetCompleted(bool synch, Stream writeStream)
{
this.synch = synch;
this.writeStream = writeStream;
this.exc = null;
object obj = this.locker;
lock (obj)
{
this.isCompleted = true;
if (this.handle != null)
{
this.handle.Set();
}
}
}
// Token: 0x0600158E RID: 5518 RVA: 0x0004525C File Offset: 0x0004345C
internal void SetCompleted(bool synch, HttpWebResponse response)
{
this.synch = synch;
this.response = response;
this.exc = null;
object obj = this.locker;
lock (obj)
{
this.isCompleted = true;
if (this.handle != null)
{
this.handle.Set();
}
}
}
// Token: 0x0600158F RID: 5519 RVA: 0x000452D4 File Offset: 0x000434D4
internal void DoCallback()
{
if (!this.callbackDone && this.cb != null)
{
this.callbackDone = true;
this.cb(this);
}
}
// Token: 0x06001590 RID: 5520 RVA: 0x00045300 File Offset: 0x00043500
internal void WaitUntilComplete()
{
if (this.IsCompleted)
{
return;
}
this.AsyncWaitHandle.WaitOne();
}
// Token: 0x06001591 RID: 5521 RVA: 0x0004531C File Offset: 0x0004351C
internal bool WaitUntilComplete(int timeout, bool exitContext)
{
return this.IsCompleted || this.AsyncWaitHandle.WaitOne(timeout, exitContext);
}
// Token: 0x1700070F RID: 1807
// (get) Token: 0x06001592 RID: 5522 RVA: 0x00045344 File Offset: 0x00043544
public object AsyncState
{
get
{
return this.state;
}
}
// Token: 0x17000710 RID: 1808
// (get) Token: 0x06001593 RID: 5523 RVA: 0x0004534C File Offset: 0x0004354C
public WaitHandle AsyncWaitHandle
{
get
{
object obj = this.locker;
lock (obj)
{
if (this.handle == null)
{
this.handle = new ManualResetEvent(this.isCompleted);
}
}
return this.handle;
}
}
// Token: 0x17000711 RID: 1809
// (get) Token: 0x06001594 RID: 5524 RVA: 0x000453B0 File Offset: 0x000435B0
public bool CompletedSynchronously
{
get
{
return this.synch;
}
}
// Token: 0x17000712 RID: 1810
// (get) Token: 0x06001595 RID: 5525 RVA: 0x000453B8 File Offset: 0x000435B8
public bool IsCompleted
{
get
{
object obj = this.locker;
bool flag;
lock (obj)
{
flag = this.isCompleted;
}
return flag;
}
}
// Token: 0x17000713 RID: 1811
// (get) Token: 0x06001596 RID: 5526 RVA: 0x00045408 File Offset: 0x00043608
internal bool GotException
{
get
{
return this.exc != null;
}
}
// Token: 0x17000714 RID: 1812
// (get) Token: 0x06001597 RID: 5527 RVA: 0x00045418 File Offset: 0x00043618
internal Exception Exception
{
get
{
return this.exc;
}
}
// Token: 0x17000715 RID: 1813
// (get) Token: 0x06001598 RID: 5528 RVA: 0x00045420 File Offset: 0x00043620
// (set) Token: 0x06001599 RID: 5529 RVA: 0x00045428 File Offset: 0x00043628
internal int NBytes
{
get
{
return this.nbytes;
}
set
{
this.nbytes = value;
}
}
// Token: 0x17000716 RID: 1814
// (get) Token: 0x0600159A RID: 5530 RVA: 0x00045434 File Offset: 0x00043634
// (set) Token: 0x0600159B RID: 5531 RVA: 0x0004543C File Offset: 0x0004363C
internal IAsyncResult InnerAsyncResult
{
get
{
return this.innerAsyncResult;
}
set
{
this.innerAsyncResult = value;
}
}
// Token: 0x17000717 RID: 1815
// (get) Token: 0x0600159C RID: 5532 RVA: 0x00045448 File Offset: 0x00043648
internal Stream WriteStream
{
get
{
return this.writeStream;
}
}
// Token: 0x17000718 RID: 1816
// (get) Token: 0x0600159D RID: 5533 RVA: 0x00045450 File Offset: 0x00043650
internal HttpWebResponse Response
{
get
{
return this.response;
}
}
// Token: 0x17000719 RID: 1817
// (get) Token: 0x0600159E RID: 5534 RVA: 0x00045458 File Offset: 0x00043658
internal byte[] Buffer
{
get
{
return this.buffer;
}
}
// Token: 0x1700071A RID: 1818
// (get) Token: 0x0600159F RID: 5535 RVA: 0x00045460 File Offset: 0x00043660
internal int Offset
{
get
{
return this.offset;
}
}
// Token: 0x1700071B RID: 1819
// (get) Token: 0x060015A0 RID: 5536 RVA: 0x00045468 File Offset: 0x00043668
internal int Size
{
get
{
return this.size;
}
}
// Token: 0x040011E0 RID: 4576
private ManualResetEvent handle;
// Token: 0x040011E1 RID: 4577
private bool synch;
// Token: 0x040011E2 RID: 4578
private bool isCompleted;
// Token: 0x040011E3 RID: 4579
private AsyncCallback cb;
// Token: 0x040011E4 RID: 4580
private object state;
// Token: 0x040011E5 RID: 4581
private int nbytes;
// Token: 0x040011E6 RID: 4582
private IAsyncResult innerAsyncResult;
// Token: 0x040011E7 RID: 4583
private bool callbackDone;
// Token: 0x040011E8 RID: 4584
private Exception exc;
// Token: 0x040011E9 RID: 4585
private HttpWebResponse response;
// Token: 0x040011EA RID: 4586
private Stream writeStream;
// Token: 0x040011EB RID: 4587
private byte[] buffer;
// Token: 0x040011EC RID: 4588
private int offset;
// Token: 0x040011ED RID: 4589
private int size;
// Token: 0x040011EE RID: 4590
private object locker = new object();
// Token: 0x040011EF RID: 4591
public bool EndCalled;
// Token: 0x040011F0 RID: 4592
public bool AsyncWriteAll;
}
}