This commit is contained in:
niko
2026-04-12 16:51:38 +02:00
parent 1b6f6d81d0
commit c12fbe3fc6
17828 changed files with 2994770 additions and 0 deletions
@@ -0,0 +1,36 @@
using System;
using BestHTTP.WebSocket.Frames;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket.Extensions
{
// Token: 0x020019B0 RID: 6576
[Token(Token = "0x20019B0")]
public interface IExtension
{
// Token: 0x06009937 RID: 39223
[Token(Token = "0x6009937")]
[Address(Slot = "0")]
void AddNegotiation(HTTPRequest request);
// Token: 0x06009938 RID: 39224
[Token(Token = "0x6009938")]
[Address(Slot = "1")]
bool ParseNegotiation(WebSocketResponse resp);
// Token: 0x06009939 RID: 39225
[Token(Token = "0x6009939")]
[Address(Slot = "2")]
byte GetFrameHeader(WebSocketFrame writer, byte inFlag);
// Token: 0x0600993A RID: 39226
[Token(Token = "0x600993A")]
[Address(Slot = "3")]
byte[] Encode(WebSocketFrame writer);
// Token: 0x0600993B RID: 39227
[Token(Token = "0x600993B")]
[Address(Slot = "4")]
byte[] Decode(byte header, byte[] data, int length);
}
}
@@ -0,0 +1,327 @@
using System;
using BestHTTP.Decompression.Zlib;
using BestHTTP.Extensions;
using BestHTTP.WebSocket.Frames;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket.Extensions
{
// Token: 0x020019B1 RID: 6577
[Token(Token = "0x20019B1")]
public sealed class PerMessageCompression : IExtension
{
// Token: 0x17001863 RID: 6243
// (get) Token: 0x0600993C RID: 39228 RVA: 0x001F5018 File Offset: 0x001F3218
// (set) Token: 0x0600993D RID: 39229 RVA: 0x001F502C File Offset: 0x001F322C
[Token(Token = "0x17001863")]
public bool ClientNoContextTakeover
{
[Token(Token = "0x600993C")]
[Address(RVA = "0x4944B0", Offset = "0x4934B0", VA = "0x1804944B0")]
get;
[Token(Token = "0x600993D")]
[Address(RVA = "0x62ADC0", Offset = "0x629DC0", VA = "0x18062ADC0")]
private set;
}
// Token: 0x17001864 RID: 6244
// (get) Token: 0x0600993E RID: 39230 RVA: 0x001F5040 File Offset: 0x001F3240
// (set) Token: 0x0600993F RID: 39231 RVA: 0x001F5054 File Offset: 0x001F3254
[Token(Token = "0x17001864")]
public bool ServerNoContextTakeover
{
[Token(Token = "0x600993E")]
[Address(RVA = "0x498E20", Offset = "0x497E20", VA = "0x180498E20")]
get;
[Token(Token = "0x600993F")]
[Address(RVA = "0x62FA00", Offset = "0x62EA00", VA = "0x18062FA00")]
private set;
}
// Token: 0x17001865 RID: 6245
// (get) Token: 0x06009940 RID: 39232 RVA: 0x001F5068 File Offset: 0x001F3268
// (set) Token: 0x06009941 RID: 39233 RVA: 0x001F507C File Offset: 0x001F327C
[Token(Token = "0x17001865")]
public int ClientMaxWindowBits
{
[Token(Token = "0x6009940")]
[Address(RVA = "0x4936D0", Offset = "0x4926D0", VA = "0x1804936D0")]
get;
[Token(Token = "0x6009941")]
[Address(RVA = "0x5F1920", Offset = "0x5F0920", VA = "0x1805F1920")]
private set;
}
// Token: 0x17001866 RID: 6246
// (get) Token: 0x06009942 RID: 39234 RVA: 0x001F5090 File Offset: 0x001F3290
// (set) Token: 0x06009943 RID: 39235 RVA: 0x001F50A4 File Offset: 0x001F32A4
[Token(Token = "0x17001866")]
public int ServerMaxWindowBits
{
[Token(Token = "0x6009942")]
[Address(RVA = "0x411540", Offset = "0x410540", VA = "0x180411540")]
get;
[Token(Token = "0x6009943")]
[Address(RVA = "0x5F1910", Offset = "0x5F0910", VA = "0x1805F1910")]
private set;
}
// Token: 0x17001867 RID: 6247
// (get) Token: 0x06009944 RID: 39236 RVA: 0x001F50B8 File Offset: 0x001F32B8
// (set) Token: 0x06009945 RID: 39237 RVA: 0x001F50CC File Offset: 0x001F32CC
[Token(Token = "0x17001867")]
public CompressionLevel Level
{
[Token(Token = "0x6009944")]
[Address(RVA = "0x497590", Offset = "0x496590", VA = "0x180497590")]
get;
[Token(Token = "0x6009945")]
[Address(RVA = "0x50A2B0", Offset = "0x5092B0", VA = "0x18050A2B0")]
private set;
}
// Token: 0x17001868 RID: 6248
// (get) Token: 0x06009946 RID: 39238 RVA: 0x001F50E0 File Offset: 0x001F32E0
// (set) Token: 0x06009947 RID: 39239 RVA: 0x001F50F4 File Offset: 0x001F32F4
[Token(Token = "0x17001868")]
public int MinimumDataLegthToCompress
{
[Token(Token = "0x6009946")]
[Address(RVA = "0x470B70", Offset = "0x46FB70", VA = "0x180470B70")]
get;
[Token(Token = "0x6009947")]
[Address(RVA = "0x62ADB0", Offset = "0x629DB0", VA = "0x18062ADB0")]
set;
}
// Token: 0x06009948 RID: 39240 RVA: 0x001F5108 File Offset: 0x001F3308
[Token(Token = "0x6009948")]
[Address(RVA = "0x62F9C0", Offset = "0x62E9C0", VA = "0x18062F9C0")]
public PerMessageCompression()
{
this.Level = (CompressionLevel)((ulong)6L);
this.ClientNoContextTakeover = false;
this.ClientMaxWindowBits = (int)((ulong)15L);
this.ServerMaxWindowBits = (int)((ulong)15L);
this.MinimumDataLegthToCompress = (int)((ulong)256L);
}
// Token: 0x06009949 RID: 39241 RVA: 0x001F514C File Offset: 0x001F334C
[Token(Token = "0x6009949")]
[Address(RVA = "0x62F970", Offset = "0x62E970", VA = "0x18062F970")]
public PerMessageCompression(CompressionLevel level, bool clientNoContextTakeover, bool serverNoContextTakeover, int desiredClientMaxWindowBits, int desiredServerMaxWindowBits, int minDatalengthToCompress)
{
this.ClientMaxWindowBits = 0;
this.ServerMaxWindowBits = 0;
this.Level = level;
this.MinimumDataLegthToCompress = 0;
this.ClientNoContextTakeover = clientNoContextTakeover;
}
// Token: 0x0600994A RID: 39242 RVA: 0x001F5184 File Offset: 0x001F3384
[Token(Token = "0x600994A")]
[Address(RVA = "0x62EE20", Offset = "0x62DE20", VA = "0x18062EE20", Slot = "4")]
public void AddNegotiation(HTTPRequest request)
{
if (this.<ServerNoContextTakeover>k__BackingField)
{
string text = "permessage-deflate" + "; server_no_context_takeover";
}
string text2;
if (this.<ClientNoContextTakeover>k__BackingField)
{
text2 = "permessage-deflate" + "; client_no_context_takeover";
}
int num = this.<ServerMaxWindowBits>k__BackingField;
if (num == 15)
{
this.<ServerMaxWindowBits>k__BackingField = num;
}
string text4;
string text3 = text2 + "; server_max_window_bits=" + text4;
if (this.<ClientMaxWindowBits>k__BackingField == 15)
{
string text5 = text3 + "; client_max_window_bits";
this.<ClientMaxWindowBits>k__BackingField = (int)((ulong)15L);
}
string text7;
string text6 = text3 + "; client_max_window_bits=" + text7;
request.AddHeader("Sec-WebSocket-Extensions", text6);
}
// Token: 0x0600994B RID: 39243 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600994B")]
[Address(RVA = "0x62F5E0", Offset = "0x62E5E0", VA = "0x18062F5E0", Slot = "5")]
public bool ParseNegotiation(WebSocketResponse resp)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600994C RID: 39244 RVA: 0x001F522C File Offset: 0x001F342C
[Token(Token = "0x600994C")]
[Address(RVA = "0x62F5A0", Offset = "0x62E5A0", VA = "0x18062F5A0", Slot = "6")]
public byte GetFrameHeader(WebSocketFrame writer, byte inFlag)
{
WebSocketFrameTypes <Type>k__BackingField = writer.<Type>k__BackingField;
if (writer.<Data>k__BackingField != 0)
{
int num = this.<MinimumDataLegthToCompress>k__BackingField;
}
return inFlag;
}
// Token: 0x0600994D RID: 39245 RVA: 0x001F5258 File Offset: 0x001F3458
[Token(Token = "0x600994D")]
[Address(RVA = "0x62F4F0", Offset = "0x62E4F0", VA = "0x18062F4F0", Slot = "7")]
public byte[] Encode(WebSocketFrame writer)
{
byte[] <Data>k__BackingField = writer.<Data>k__BackingField;
if (<Data>k__BackingField != 0)
{
return <Data>k__BackingField;
}
return VariableSizedBufferPool.NoData;
}
// Token: 0x0600994E RID: 39246 RVA: 0x001F5290 File Offset: 0x001F3490
[Token(Token = "0x600994E")]
[Address(RVA = "0x62F1C0", Offset = "0x62E1C0", VA = "0x18062F1C0", Slot = "8")]
public byte[] Decode(byte header, byte[] data, int length)
{
return this.Decompress(data, length);
}
// Token: 0x0600994F RID: 39247 RVA: 0x001F52A8 File Offset: 0x001F34A8
[Token(Token = "0x600994F")]
[Address(RVA = "0x62EF50", Offset = "0x62DF50", VA = "0x18062EF50")]
private byte[] Compress(byte[] data, int length)
{
int num;
byte[] array;
do
{
num = 0;
if (this.compressorOutputStream == 0)
{
BufferPoolMemoryStream bufferPoolMemoryStream = new BufferPoolMemoryStream();
this.compressorOutputStream = bufferPoolMemoryStream;
}
if (this.compressorDeflateStream == num)
{
CompressionLevel compressionLevel = this.<Level>k__BackingField;
int num2 = this.<ClientMaxWindowBits>k__BackingField;
DeflateStream deflateStream;
this.compressorDeflateStream = deflateStream;
FlushType flushMode = deflateStream.FlushMode;
}
int num3 = this.compressorDeflateStream.ReadByte();
DeflateStream deflateStream2 = this.compressorDeflateStream;
long position = this.compressorOutputStream.Position;
bool canWrite = this.compressorOutputStream.CanWrite;
array = this.compressorOutputStream.ToArray();
if (this.<ClientNoContextTakeover>k__BackingField)
{
this.compressorDeflateStream.Dispose();
this.compressorDeflateStream = (ulong)0L;
}
}
while (num != 0);
return array;
}
// Token: 0x06009950 RID: 39248 RVA: 0x001F5388 File Offset: 0x001F3588
[Token(Token = "0x6009950")]
[Address(RVA = "0x62F1E0", Offset = "0x62E1E0", VA = "0x18062F1E0")]
private byte[] Decompress(byte[] data, int length)
{
BufferPoolMemoryStream bufferPoolMemoryStream = this.decompressorInputStream;
if (bufferPoolMemoryStream == 0)
{
int num;
BufferPoolMemoryStream bufferPoolMemoryStream2 = new BufferPoolMemoryStream(num);
num = data.Length;
num += 4;
this.decompressorInputStream = bufferPoolMemoryStream2;
}
int num2 = bufferPoolMemoryStream.ReadByte();
BufferPoolMemoryStream bufferPoolMemoryStream3 = this.decompressorInputStream;
byte[] trailer = PerMessageCompression.Trailer;
int num3 = bufferPoolMemoryStream3.ReadByte();
long position = this.decompressorInputStream.Position;
int num4 = 0;
if (this.decompressorDeflateStream == num4)
{
BufferPoolMemoryStream bufferPoolMemoryStream4 = this.decompressorInputStream;
int num5 = this.<ServerMaxWindowBits>k__BackingField;
ulong num6;
DeflateStream deflateStream = new DeflateStream(bufferPoolMemoryStream4, CompressionMode.Decompress, CompressionLevel.Default, num6 != 0UL, num5);
this.decompressorDeflateStream = deflateStream;
FlushType flushMode = deflateStream.FlushMode;
}
if (this.decompressorOutputStream == 0)
{
BufferPoolMemoryStream bufferPoolMemoryStream5 = new BufferPoolMemoryStream();
this.decompressorOutputStream = bufferPoolMemoryStream5;
}
uint num7;
ulong num8;
byte[] array = VariableSizedBufferPool.Get((long)num7, num8 != 0UL);
DeflateStream deflateStream2 = this.decompressorDeflateStream;
int num9 = this.decompressorOutputStream.ReadByte();
VariableSizedBufferPool.Release(array);
DeflateStream deflateStream3 = this.decompressorDeflateStream;
byte[] array2 = this.decompressorOutputStream.ToArray();
if ((this.<ServerNoContextTakeover>k__BackingField ? 1 : 0) != num4)
{
this.decompressorDeflateStream.Dispose();
this.decompressorDeflateStream = num4;
}
return array2;
}
// Token: 0x06009951 RID: 39249 RVA: 0x001F549C File Offset: 0x001F369C
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x6009951")]
[Address(RVA = "0x62F8E0", Offset = "0x62E8E0", VA = "0x18062F8E0")]
static PerMessageCompression()
{
byte[] array = new byte[4];
array[0] = (byte)((ulong)255L);
array[0] = (byte)((ulong)255L);
PerMessageCompression.Trailer = array;
}
// Token: 0x040067A5 RID: 26533
[Token(Token = "0x40067A5")]
public const int MinDataLengthToCompressDefault = 256;
// Token: 0x040067A6 RID: 26534
[Token(Token = "0x40067A6")]
private static readonly byte[] Trailer;
// Token: 0x040067AD RID: 26541
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x40067AD")]
private BufferPoolMemoryStream compressorOutputStream;
// Token: 0x040067AE RID: 26542
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x40067AE")]
private DeflateStream compressorDeflateStream;
// Token: 0x040067AF RID: 26543
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x40067AF")]
private BufferPoolMemoryStream decompressorInputStream;
// Token: 0x040067B0 RID: 26544
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x40067B0")]
private BufferPoolMemoryStream decompressorOutputStream;
// Token: 0x040067B1 RID: 26545
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x40067B1")]
private DeflateStream decompressorDeflateStream;
}
}
@@ -0,0 +1,36 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket.Frames
{
// Token: 0x020019AC RID: 6572
[Token(Token = "0x20019AC")]
public struct RawFrameData : IDisposable
{
// Token: 0x06009911 RID: 39185 RVA: 0x001F49B8 File Offset: 0x001F2BB8
[Token(Token = "0x6009911")]
[Address(RVA = "0x62FA90", Offset = "0x62EA90", VA = "0x18062FA90")]
public RawFrameData(byte[] data, int length)
{
this.Data = data;
this.Length = length;
}
// Token: 0x06009912 RID: 39186 RVA: 0x001F49D4 File Offset: 0x001F2BD4
[Token(Token = "0x6009912")]
[Address(RVA = "0x62FA20", Offset = "0x62EA20", VA = "0x18062FA20", Slot = "4")]
public void Dispose()
{
}
// Token: 0x0400678F RID: 26511
[FieldOffset(Offset = "0x0")]
[Token(Token = "0x400678F")]
public byte[] Data;
// Token: 0x04006790 RID: 26512
[FieldOffset(Offset = "0x8")]
[Token(Token = "0x4006790")]
public int Length;
}
}
@@ -0,0 +1,228 @@
using System;
using BestHTTP.Extensions;
using BestHTTP.WebSocket.Extensions;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket.Frames
{
// Token: 0x020019AD RID: 6573
[Token(Token = "0x20019AD")]
public sealed class WebSocketFrame
{
// Token: 0x17001856 RID: 6230
// (get) Token: 0x06009913 RID: 39187 RVA: 0x001F49E4 File Offset: 0x001F2BE4
// (set) Token: 0x06009914 RID: 39188 RVA: 0x001F49F8 File Offset: 0x001F2BF8
[Token(Token = "0x17001856")]
public WebSocketFrameTypes Type
{
[Token(Token = "0x6009913")]
[Address(RVA = "0x4944B0", Offset = "0x4934B0", VA = "0x1804944B0")]
get;
[Token(Token = "0x6009914")]
[Address(RVA = "0x62ADC0", Offset = "0x629DC0", VA = "0x18062ADC0")]
private set;
}
// Token: 0x17001857 RID: 6231
// (get) Token: 0x06009915 RID: 39189 RVA: 0x001F4A0C File Offset: 0x001F2C0C
// (set) Token: 0x06009916 RID: 39190 RVA: 0x001F4A20 File Offset: 0x001F2C20
[Token(Token = "0x17001857")]
public bool IsFinal
{
[Token(Token = "0x6009915")]
[Address(RVA = "0x498E20", Offset = "0x497E20", VA = "0x180498E20")]
get;
[Token(Token = "0x6009916")]
[Address(RVA = "0x62FA00", Offset = "0x62EA00", VA = "0x18062FA00")]
private set;
}
// Token: 0x17001858 RID: 6232
// (get) Token: 0x06009917 RID: 39191 RVA: 0x001F4A34 File Offset: 0x001F2C34
// (set) Token: 0x06009918 RID: 39192 RVA: 0x001F4A48 File Offset: 0x001F2C48
[Token(Token = "0x17001858")]
public byte Header
{
[Token(Token = "0x6009917")]
[Address(RVA = "0x635090", Offset = "0x634090", VA = "0x180635090")]
get;
[Token(Token = "0x6009918")]
[Address(RVA = "0x6350B0", Offset = "0x6340B0", VA = "0x1806350B0")]
private set;
}
// Token: 0x17001859 RID: 6233
// (get) Token: 0x06009919 RID: 39193 RVA: 0x001F4A5C File Offset: 0x001F2C5C
// (set) Token: 0x0600991A RID: 39194 RVA: 0x001F4A70 File Offset: 0x001F2C70
[Token(Token = "0x17001859")]
public byte[] Data
{
[Token(Token = "0x6009919")]
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")]
get;
[Token(Token = "0x600991A")]
[Address(RVA = "0x4157F0", Offset = "0x4147F0", VA = "0x1804157F0")]
private set;
}
// Token: 0x1700185A RID: 6234
// (get) Token: 0x0600991B RID: 39195 RVA: 0x001F4A84 File Offset: 0x001F2C84
// (set) Token: 0x0600991C RID: 39196 RVA: 0x001F4A98 File Offset: 0x001F2C98
[Token(Token = "0x1700185A")]
public int DataLength
{
[Token(Token = "0x600991B")]
[Address(RVA = "0x470B70", Offset = "0x46FB70", VA = "0x180470B70")]
get;
[Token(Token = "0x600991C")]
[Address(RVA = "0x62ADB0", Offset = "0x629DB0", VA = "0x18062ADB0")]
private set;
}
// Token: 0x1700185B RID: 6235
// (get) Token: 0x0600991D RID: 39197 RVA: 0x001F4AAC File Offset: 0x001F2CAC
// (set) Token: 0x0600991E RID: 39198 RVA: 0x001F4AC0 File Offset: 0x001F2CC0
[Token(Token = "0x1700185B")]
public bool UseExtensions
{
[Token(Token = "0x600991D")]
[Address(RVA = "0x6350A0", Offset = "0x6340A0", VA = "0x1806350A0")]
get;
[Token(Token = "0x600991E")]
[Address(RVA = "0x6350C0", Offset = "0x6340C0", VA = "0x1806350C0")]
private set;
}
// Token: 0x0600991F RID: 39199 RVA: 0x001F4AD4 File Offset: 0x001F2CD4
[Token(Token = "0x600991F")]
[Address(RVA = "0x635040", Offset = "0x634040", VA = "0x180635040")]
public WebSocketFrame(WebSocket webSocket, WebSocketFrameTypes type, byte[] data)
{
if (data != 0)
{
}
}
// Token: 0x06009920 RID: 39200 RVA: 0x001F4AF0 File Offset: 0x001F2CF0
[Token(Token = "0x6009920")]
[Address(RVA = "0x634F90", Offset = "0x633F90", VA = "0x180634F90")]
public WebSocketFrame(WebSocket webSocket, WebSocketFrameTypes type, byte[] data, bool useExtensions)
{
if (data != 0)
{
}
}
// Token: 0x06009921 RID: 39201 RVA: 0x001F4B0C File Offset: 0x001F2D0C
[Token(Token = "0x6009921")]
[Address(RVA = "0x634FE0", Offset = "0x633FE0", VA = "0x180634FE0")]
public WebSocketFrame(WebSocket webSocket, WebSocketFrameTypes type, byte[] data, bool isFinal, bool useExtensions)
{
if (data != 0)
{
}
}
// Token: 0x06009922 RID: 39202 RVA: 0x001F4B28 File Offset: 0x001F2D28
[Token(Token = "0x6009922")]
[Address(RVA = "0x634DA0", Offset = "0x633DA0", VA = "0x180634DA0")]
public WebSocketFrame(WebSocket webSocket, WebSocketFrameTypes type, byte[] data, ulong pos, ulong length, bool isFinal, bool useExtensions)
{
this.IsFinal = false;
this.Type = type;
int num = 0;
this.UseExtensions = false;
this.DataLength = 0;
if (data == 0)
{
}
int num2 = this.<DataLength>k__BackingField;
byte[] array;
this.Data = array;
this.Header = data;
if ((this.<UseExtensions>k__BackingField ? 1 : 0) != num && webSocket != 0 && webSocket.<Extensions>k__BackingField != num)
{
IExtension[] <Extensions>k__BackingField = webSocket.<Extensions>k__BackingField;
int length2 = <Extensions>k__BackingField.Length;
if (num < length2)
{
if (<Extensions>k__BackingField[num] != 0)
{
byte b = this.<Header>k__BackingField;
this.Header = (byte)num;
byte[] array2 = this.<Data>k__BackingField;
if (num != array2)
{
VariableSizedBufferPool.Release(array2);
this.Data = num;
this.DataLength = num;
}
}
num++;
}
}
}
// Token: 0x06009923 RID: 39203 RVA: 0x001F4BE4 File Offset: 0x001F2DE4
[Token(Token = "0x6009923")]
[Address(RVA = "0x6349D0", Offset = "0x6339D0", VA = "0x1806349D0")]
public RawFrameData Get()
{
int num;
do
{
num = 0;
byte[] noData = VariableSizedBufferPool.NoData;
byte[] array;
int length = array.Length;
int num2 = 0;
Array.Reverse(array, num2, length);
byte[] array2;
int length2 = array2.Length;
int num3 = 0;
Array.Reverse(array2, num3, length2);
BufferPoolMemoryStream bufferPoolMemoryStream;
int num4 = bufferPoolMemoryStream.ReadByte();
int num5 = bufferPoolMemoryStream.ReadByte();
if (num < "{il2cpp array field il2cppMethodInfo->}")
{
num++;
num++;
}
byte[] array3 = bufferPoolMemoryStream.ToArray(true);
bool canWrite = bufferPoolMemoryStream.CanWrite;
if (bufferPoolMemoryStream != 0)
{
}
}
while (num != 0);
throw new NullReferenceException();
}
// Token: 0x06009924 RID: 39204 RVA: 0x001F4C94 File Offset: 0x001F2E94
[Token(Token = "0x6009924")]
[Address(RVA = "0x6347D0", Offset = "0x6337D0", VA = "0x1806347D0")]
public WebSocketFrame[] Fragment(ushort maxFragmentSize)
{
if (this.<Data>k__BackingField != (ulong)0L)
{
WebSocketFrameTypes webSocketFrameTypes = this.<Type>k__BackingField;
if (this.<DataLength>k__BackingField > (int)maxFragmentSize)
{
WebSocketFrame[] array = new WebSocketFrame[(int)maxFragmentSize];
int num = this.<DataLength>k__BackingField;
if ((int)maxFragmentSize < num)
{
num -= (int)maxFragmentSize;
ulong num2 = Math.Min((ulong)maxFragmentSize, (ulong)num);
int num3 = this.<DataLength>k__BackingField;
throw new ArrayTypeMismatchException();
}
this.<DataLength>k__BackingField = (int)maxFragmentSize;
return array;
}
}
throw new IndexOutOfRangeException();
}
}
}
@@ -0,0 +1,266 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using BestHTTP.Extensions;
using BestHTTP.WebSocket.Extensions;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket.Frames
{
// Token: 0x020019AE RID: 6574
[Token(Token = "0x20019AE")]
public struct WebSocketFrameReader
{
// Token: 0x1700185C RID: 6236
// (get) Token: 0x06009925 RID: 39205 RVA: 0x0000220F File Offset: 0x0000040F
// (set) Token: 0x06009926 RID: 39206 RVA: 0x001F4D18 File Offset: 0x001F2F18
[Token(Token = "0x1700185C")]
public byte Header
{
[Token(Token = "0x6009925")]
[Address(RVA = "0x634740", Offset = "0x633740", VA = "0x180634740")]
[CompilerGenerated]
get
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
[Token(Token = "0x6009926")]
[Address(RVA = "0x634790", Offset = "0x633790", VA = "0x180634790")]
[CompilerGenerated]
private set
{
this.<Header>k__BackingField = value;
}
}
// Token: 0x1700185D RID: 6237
// (get) Token: 0x06009927 RID: 39207 RVA: 0x001F4D2C File Offset: 0x001F2F2C
// (set) Token: 0x06009928 RID: 39208 RVA: 0x001F4D40 File Offset: 0x001F2F40
[Token(Token = "0x1700185D")]
public bool IsFinal
{
[Token(Token = "0x6009927")]
[Address(RVA = "0x634750", Offset = "0x633750", VA = "0x180634750")]
get;
[Token(Token = "0x6009928")]
[Address(RVA = "0x6347A0", Offset = "0x6337A0", VA = "0x1806347A0")]
private set;
}
// Token: 0x1700185E RID: 6238
// (get) Token: 0x06009929 RID: 39209 RVA: 0x001F4D54 File Offset: 0x001F2F54
// (set) Token: 0x0600992A RID: 39210 RVA: 0x001F4D68 File Offset: 0x001F2F68
[Token(Token = "0x1700185E")]
public WebSocketFrameTypes Type
{
[Token(Token = "0x6009929")]
[Address(RVA = "0x634770", Offset = "0x633770", VA = "0x180634770")]
get;
[Token(Token = "0x600992A")]
[Address(RVA = "0x6347C0", Offset = "0x6337C0", VA = "0x1806347C0")]
private set;
}
// Token: 0x1700185F RID: 6239
// (get) Token: 0x0600992B RID: 39211 RVA: 0x001F4D7C File Offset: 0x001F2F7C
// (set) Token: 0x0600992C RID: 39212 RVA: 0x001F4D90 File Offset: 0x001F2F90
[Token(Token = "0x1700185F")]
public bool HasMask
{
[Token(Token = "0x600992B")]
[Address(RVA = "0x634730", Offset = "0x633730", VA = "0x180634730")]
get;
[Token(Token = "0x600992C")]
[Address(RVA = "0x634780", Offset = "0x633780", VA = "0x180634780")]
private set;
}
// Token: 0x17001860 RID: 6240
// (get) Token: 0x0600992D RID: 39213 RVA: 0x001F4DA4 File Offset: 0x001F2FA4
// (set) Token: 0x0600992E RID: 39214 RVA: 0x001F4DB8 File Offset: 0x001F2FB8
[Token(Token = "0x17001860")]
public ulong Length
{
[Token(Token = "0x600992D")]
[Address(RVA = "0x634760", Offset = "0x633760", VA = "0x180634760")]
get;
[Token(Token = "0x600992E")]
[Address(RVA = "0x6347B0", Offset = "0x6337B0", VA = "0x1806347B0")]
private set;
}
// Token: 0x17001861 RID: 6241
// (get) Token: 0x0600992F RID: 39215 RVA: 0x001F4DCC File Offset: 0x001F2FCC
// (set) Token: 0x06009930 RID: 39216 RVA: 0x001F4DE0 File Offset: 0x001F2FE0
[Token(Token = "0x17001861")]
public byte[] Data
{
[Token(Token = "0x600992F")]
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
get;
[Token(Token = "0x6009930")]
[Address(RVA = "0x415800", Offset = "0x414800", VA = "0x180415800")]
private set;
}
// Token: 0x17001862 RID: 6242
// (get) Token: 0x06009931 RID: 39217 RVA: 0x001F4DF4 File Offset: 0x001F2FF4
// (set) Token: 0x06009932 RID: 39218 RVA: 0x001F4E08 File Offset: 0x001F3008
[Token(Token = "0x17001862")]
public string DataAsText
{
[Token(Token = "0x6009931")]
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")]
get;
[Token(Token = "0x6009932")]
[Address(RVA = "0x4157F0", Offset = "0x4147F0", VA = "0x1804157F0")]
private set;
}
// Token: 0x06009933 RID: 39219 RVA: 0x001F4E1C File Offset: 0x001F301C
[Token(Token = "0x6009933")]
[Address(RVA = "0x6341E0", Offset = "0x6331E0", VA = "0x1806341E0")]
internal void Read(Stream stream)
{
int num;
this.<Header>k__BackingField = (byte)num;
this.<IsFinal>k__BackingField = stream != null;
this.<Type>k__BackingField = (WebSocketFrameTypes)num;
this.<HasMask>k__BackingField = stream != null;
int num2;
this.<Length>k__BackingField = (ulong)num2;
if (num2 != 126)
{
if (num2 != 127)
{
goto IL_81;
}
byte[] array;
stream.ReadBuffer(array, 8);
int num3 = 0;
Array.Reverse(array, num3, 8);
int num4 = 0;
ulong num5 = BitConverter.ToUInt64(array, num4);
}
byte[] array2;
stream.ReadBuffer(array2, 2);
int num6 = 0;
Array.Reverse(array2, num6, 2);
int num7 = 0;
ushort num8 = BitConverter.ToUInt16(array2, num7);
this.<Length>k__BackingField = (ulong)num8;
VariableSizedBufferPool.Release(array2);
IL_81:
int num9 = 0;
if ((this.<HasMask>k__BackingField ? 1 : 0) != num9)
{
}
ulong num10 = this.<Length>k__BackingField;
if (num10 != (ulong)0L)
{
ulong num11;
if (num10 > num11)
{
throw new OverflowException();
}
byte[] array3 = new byte[num10];
}
ulong num12;
byte[] array4 = VariableSizedBufferPool.Get((long)this.<Length>k__BackingField, num12 != 0UL);
this.<Data>k__BackingField = array4;
ulong num13 = this.<Length>k__BackingField;
if (num13 != (ulong)0L)
{
num13 -= (ulong)num9;
ulong num14 = this.<Length>k__BackingField;
if ((this.<HasMask>k__BackingField ? 1 : 0) != num9)
{
if (num14 != (ulong)0L)
{
byte[] array5 = this.<Data>k__BackingField;
num9++;
}
byte[] array6;
VariableSizedBufferPool.Release(array6);
}
}
}
// Token: 0x06009934 RID: 39220 RVA: 0x001F4F3C File Offset: 0x001F313C
[Token(Token = "0x6009934")]
[Address(RVA = "0x634170", Offset = "0x633170", VA = "0x180634170")]
private byte ReadByte(Stream stream)
{
/*
An exception occurred when decompiling this method (06009934)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte BestHTTP.WebSocket.Frames.WebSocketFrameReader::ReadByte(System.IO.Stream)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:Exception(var_2_07, call:Exception(ExceptionHelper::ServerClosedTCPStream))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x06009935 RID: 39221 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009935")]
[Address(RVA = "0x633D00", Offset = "0x632D00", VA = "0x180633D00")]
public void Assemble(List<WebSocketFrameReader> fragments)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06009936 RID: 39222 RVA: 0x001F4F50 File Offset: 0x001F3150
[Token(Token = "0x6009936")]
[Address(RVA = "0x633FC0", Offset = "0x632FC0", VA = "0x180633FC0")]
public void DecodeWithExtensions(WebSocket webSocket)
{
if (webSocket.<Extensions>k__BackingField != (ulong)0L)
{
int num = 0;
int num2 = 0;
IExtension[] <Extensions>k__BackingField = webSocket.<Extensions>k__BackingField;
int length = <Extensions>k__BackingField.Length;
if (num2 < length)
{
if (<Extensions>k__BackingField[num] != 0)
{
ulong num3 = this.<Length>k__BackingField;
byte[] array = this.<Data>k__BackingField;
byte[] array2 = this.<Data>k__BackingField;
if (array2 != array)
{
VariableSizedBufferPool.Release(array2);
this.<Data>k__BackingField = array;
int length2 = array.Length;
this.<Length>k__BackingField = (ulong)length2;
}
}
num++;
}
}
if (this.<Data>k__BackingField != (ulong)0L)
{
Encoding utf = Encoding.UTF8;
byte[] array3 = this.<Data>k__BackingField;
string @string = utf.GetString(array3);
byte[] array4 = this.<Data>k__BackingField;
this.<DataAsText>k__BackingField = @string;
VariableSizedBufferPool.Release(array4);
this.<Data>k__BackingField = (ulong)0L;
}
}
}
}
@@ -0,0 +1,29 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket.Frames
{
// Token: 0x020019AF RID: 6575
[Token(Token = "0x20019AF")]
public enum WebSocketFrameTypes : byte
{
// Token: 0x0400679F RID: 26527
[Token(Token = "0x400679F")]
Continuation,
// Token: 0x040067A0 RID: 26528
[Token(Token = "0x40067A0")]
Text,
// Token: 0x040067A1 RID: 26529
[Token(Token = "0x40067A1")]
Binary,
// Token: 0x040067A2 RID: 26530
[Token(Token = "0x40067A2")]
ConnectionClose = 8,
// Token: 0x040067A3 RID: 26531
[Token(Token = "0x40067A3")]
Ping,
// Token: 0x040067A4 RID: 26532
[Token(Token = "0x40067A4")]
Pong
}
}
@@ -0,0 +1,852 @@
using System;
using System.Collections.Generic;
using System.Net.WebSockets;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Xml.Schema;
using BestHTTP.Extensions;
using BestHTTP.Logger;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket
{
// Token: 0x0200198D RID: 6541
[Token(Token = "0x200198D")]
public class NativeWebSocket
{
// Token: 0x17001846 RID: 6214
// (get) Token: 0x0600986B RID: 39019 RVA: 0x001F1878 File Offset: 0x001EFA78
// (set) Token: 0x0600986C RID: 39020 RVA: 0x001F188C File Offset: 0x001EFA8C
[Token(Token = "0x17001846")]
public WebSocketStates State
{
[Token(Token = "0x600986B")]
[Address(RVA = "0x41CF00", Offset = "0x41BF00", VA = "0x18041CF00")]
get;
[Token(Token = "0x600986C")]
[Address(RVA = "0x41D000", Offset = "0x41C000", VA = "0x18041D000")]
private set;
}
// Token: 0x0600986D RID: 39021 RVA: 0x001F18A0 File Offset: 0x001EFAA0
[Token(Token = "0x600986D")]
[Address(RVA = "0x62CB90", Offset = "0x62BB90", VA = "0x18062CB90")]
public NativeWebSocket(Uri uri)
{
int num;
do
{
num = 0;
this.State = (WebSocketStates)((ulong)4L);
ClientWebSocket clientWebSocket = new ClientWebSocket();
this._webSocket = clientWebSocket;
Queue<NativeWebSocket.OutboundMessage> queue = new Queue();
this._outboundMessageQueue = queue;
List<ArraySegment<byte>> list = new List();
this._inboundFrames = list;
List<byte[]> list2 = new List();
this._rentedBuffers = list2;
base..ctor();
bool flag = HTTPProtocolFactory.IsSecureProtocol(uri);
string text = "ws";
if (flag)
{
text = "wss";
}
if (uri.Port != -1)
{
int port = uri.Port;
}
bool flag2 = text.Equals("wss", StringComparison.OrdinalIgnoreCase);
object[] array = new object[6];
if (text != 0)
{
}
array[0] = text;
if ("://" != 0)
{
}
array[1] = "://";
string host = uri.Host;
if (host != 0)
{
}
array[2] = host;
if (":" != 0)
{
}
array[3] = ":";
if (":" != 0)
{
}
array[4] = ":";
string requestPathAndQueryURL = uri.GetRequestPathAndQueryURL();
if (requestPathAndQueryURL != 0)
{
}
array[5] = requestPathAndQueryURL;
Uri uri2 = new Uri(string.Concat(array));
this._uri = uri2;
if (!BPHGKAEDBPE.KNJJNNNAEKB(uri2))
{
break;
}
NNMAGDKDBFN nnmagdkdbfn = MHOKOMMOGKM.DMIDMJAKAJD();
Encoding utf = Encoding.UTF8;
string text3;
string text2 = "Bearer " + text3;
this._webSocket._options.SetRequestHeader("Authorization", text2);
}
while (num != 0);
}
// Token: 0x0600986E RID: 39022 RVA: 0x001F1A18 File Offset: 0x001EFC18
[Token(Token = "0x600986E")]
[Address(RVA = "0x62CB60", Offset = "0x62BB60", VA = "0x18062CB60")]
public void SetHeader(string name, string value)
{
this._webSocket._options.SetRequestHeader(name, value);
}
// Token: 0x0600986F RID: 39023 RVA: 0x001F1A40 File Offset: 0x001EFC40
[Token(Token = "0x600986F")]
[Address(RVA = "0x62C1A0", Offset = "0x62B1A0", VA = "0x18062C1A0")]
public void Open()
{
Action defaultContextAction = AsyncVoidMethodBuilder.Create().m_coreState.m_defaultContextAction;
}
// Token: 0x06009870 RID: 39024 RVA: 0x001F1A60 File Offset: 0x001EFC60
[Token(Token = "0x6009870")]
[Address(RVA = "0x62C0E0", Offset = "0x62B0E0", VA = "0x18062C0E0")]
public void Close()
{
Action defaultContextAction = AsyncVoidMethodBuilder.Create().m_coreState.m_defaultContextAction;
}
// Token: 0x06009871 RID: 39025 RVA: 0x001F1A80 File Offset: 0x001EFC80
[Token(Token = "0x6009871")]
[Address(RVA = "0x62C010", Offset = "0x62B010", VA = "0x18062C010")]
private Task CloseInternal()
{
Task task;
return task;
}
// Token: 0x06009872 RID: 39026 RVA: 0x001F1A90 File Offset: 0x001EFC90
[Token(Token = "0x6009872")]
[Address(RVA = "0x62C9E0", Offset = "0x62B9E0", VA = "0x18062C9E0")]
public void Send(string message)
{
this._webSocket.Dispose();
Queue<NativeWebSocket.OutboundMessage> outboundMessageQueue = this._outboundMessageQueue;
int num = 0;
outboundMessageQueue.Enqueue(num);
bool flag = this._outboundMessagePendingEvent.Set();
}
// Token: 0x06009873 RID: 39027 RVA: 0x001F1ACC File Offset: 0x001EFCCC
[Token(Token = "0x6009873")]
[Address(RVA = "0x62CAA0", Offset = "0x62BAA0", VA = "0x18062CAA0")]
public void Send(byte[] message)
{
this._webSocket.Dispose();
Queue<NativeWebSocket.OutboundMessage> outboundMessageQueue = this._outboundMessageQueue;
bool flag = this._outboundMessagePendingEvent.Set();
}
// Token: 0x06009874 RID: 39028 RVA: 0x001F1B00 File Offset: 0x001EFD00
[Token(Token = "0x6009874")]
[Address(RVA = "0x62C900", Offset = "0x62B900", VA = "0x18062C900")]
private Task SendLoop(CancellationToken cancellationToken)
{
Task task;
return task;
}
// Token: 0x06009875 RID: 39029 RVA: 0x001F1B10 File Offset: 0x001EFD10
[Token(Token = "0x6009875")]
[Address(RVA = "0x62C250", Offset = "0x62B250", VA = "0x18062C250")]
private Task ReceiveLoop()
{
Task task;
return task;
}
// Token: 0x06009876 RID: 39030 RVA: 0x001F1B20 File Offset: 0x001EFD20
[Token(Token = "0x6009876")]
[Address(RVA = "0x62C320", Offset = "0x62B320", VA = "0x18062C320")]
private Task<NativeWebSocket.InboundMessage> Receive()
{
AsyncTaskMethodBuilder asyncTaskMethodBuilder = AsyncTaskMethodBuilder.Create();
Task task;
return task;
}
// Token: 0x06009877 RID: 39031 RVA: 0x001F1B3C File Offset: 0x001EFD3C
[Token(Token = "0x6009877")]
[Address(RVA = "0x62C840", Offset = "0x62B840", VA = "0x18062C840")]
private void SafeRaiseOnOpen()
{
NativeWebSocket.OnWebSocketOpenDelegate onOpen = this.OnOpen;
if (onOpen != 0)
{
onOpen(this);
}
ILogger logger = HTTPManager.Logger;
}
// Token: 0x06009878 RID: 39032 RVA: 0x001F1B6C File Offset: 0x001EFD6C
[Token(Token = "0x6009878")]
[Address(RVA = "0x62C770", Offset = "0x62B770", VA = "0x18062C770")]
private void SafeRaiseOnMessage(string message)
{
NativeWebSocket.OnWebSocketMessageDelegate onMessage = this.OnMessage;
if (onMessage != 0)
{
onMessage(this, message);
}
ILogger logger = HTTPManager.Logger;
}
// Token: 0x06009879 RID: 39033 RVA: 0x001F1B9C File Offset: 0x001EFD9C
[Token(Token = "0x6009879")]
[Address(RVA = "0x62C410", Offset = "0x62B410", VA = "0x18062C410")]
private void SafeRaiseOnBinary(byte[] message)
{
NativeWebSocket.OnWebSocketBinaryDelegate onBinary = this.OnBinary;
if (onBinary != 0)
{
onBinary(this, message);
}
ILogger logger = HTTPManager.Logger;
}
// Token: 0x0600987A RID: 39034 RVA: 0x001F1BCC File Offset: 0x001EFDCC
[Token(Token = "0x600987A")]
[Address(RVA = "0x62C4E0", Offset = "0x62B4E0", VA = "0x18062C4E0")]
private void SafeRaiseOnClosed(ushort statusCode, string statusMessage)
{
NativeWebSocket.OnWebSocketClosedDelegate onClosed = this.OnClosed;
if (onClosed != 0)
{
onClosed(this, statusCode, statusMessage);
}
ILogger logger = HTTPManager.Logger;
}
// Token: 0x0600987B RID: 39035 RVA: 0x001F1BFC File Offset: 0x001EFDFC
[Token(Token = "0x600987B")]
[Address(RVA = "0x62C6A0", Offset = "0x62B6A0", VA = "0x18062C6A0")]
private void SafeRaiseOnError(Exception exception)
{
NativeWebSocket.OnWebSocketErrorDelegate onError = this.OnError;
if (onError != 0)
{
onError(this, exception);
}
ILogger logger = HTTPManager.Logger;
}
// Token: 0x0600987C RID: 39036 RVA: 0x001F1C2C File Offset: 0x001EFE2C
[Token(Token = "0x600987C")]
[Address(RVA = "0x62C5D0", Offset = "0x62B5D0", VA = "0x18062C5D0")]
private void SafeRaiseOnErrorDesc(string errorDescription)
{
NativeWebSocket.OnWebSocketErrorDescriptionDelegate onErrorDesc = this.OnErrorDesc;
if (onErrorDesc != 0)
{
onErrorDesc(this, errorDescription);
}
ILogger logger = HTTPManager.Logger;
}
// Token: 0x04006705 RID: 26373
[Token(Token = "0x4006705")]
private const int MaxFragmentSize = 32767;
// Token: 0x04006706 RID: 26374
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006706")]
public NativeWebSocket.OnWebSocketOpenDelegate OnOpen;
// Token: 0x04006707 RID: 26375
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006707")]
public NativeWebSocket.OnWebSocketMessageDelegate OnMessage;
// Token: 0x04006708 RID: 26376
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006708")]
public NativeWebSocket.OnWebSocketBinaryDelegate OnBinary;
// Token: 0x04006709 RID: 26377
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006709")]
public NativeWebSocket.OnWebSocketClosedDelegate OnClosed;
// Token: 0x0400670A RID: 26378
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x400670A")]
public NativeWebSocket.OnWebSocketErrorDelegate OnError;
// Token: 0x0400670B RID: 26379
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x400670B")]
public NativeWebSocket.OnWebSocketErrorDescriptionDelegate OnErrorDesc;
// Token: 0x0400670D RID: 26381
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x400670D")]
private readonly Uri _uri;
// Token: 0x0400670E RID: 26382
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x400670E")]
private readonly ClientWebSocket _webSocket;
// Token: 0x0400670F RID: 26383
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x400670F")]
private readonly Queue<NativeWebSocket.OutboundMessage> _outboundMessageQueue;
// Token: 0x04006710 RID: 26384
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x4006710")]
private readonly List<ArraySegment<byte>> _inboundFrames;
// Token: 0x04006711 RID: 26385
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x4006711")]
private readonly List<byte[]> _rentedBuffers;
// Token: 0x04006712 RID: 26386
[FieldOffset(Offset = "0x70")]
[Token(Token = "0x4006712")]
private CancellationTokenSource _sendLoopCancellationTokenSource;
// Token: 0x04006713 RID: 26387
[FieldOffset(Offset = "0x78")]
[Token(Token = "0x4006713")]
private AutoResetEvent _outboundMessagePendingEvent;
// Token: 0x0200198E RID: 6542
[Token(Token = "0x200198E")]
private struct OutboundMessage
{
// Token: 0x0600987D RID: 39037 RVA: 0x001F1C5C File Offset: 0x001EFE5C
[Token(Token = "0x600987D")]
[Address(RVA = "0x62EDF0", Offset = "0x62DDF0", VA = "0x18062EDF0")]
public OutboundMessage(byte[] binaryMessage)
{
this.BinaryMessage = binaryMessage;
this.TextMessage = (ulong)0L;
}
// Token: 0x0600987E RID: 39038 RVA: 0x001F1C7C File Offset: 0x001EFE7C
[Token(Token = "0x600987E")]
[Address(RVA = "0x62EE10", Offset = "0x62DE10", VA = "0x18062EE10")]
public OutboundMessage(string textMessage)
{
int num = 0;
this.TextMessage = textMessage;
this.MessageType = (WebSocketMessageType)num;
this.BinaryMessage = num;
}
// Token: 0x04006714 RID: 26388
[FieldOffset(Offset = "0x0")]
[Token(Token = "0x4006714")]
public readonly WebSocketMessageType MessageType;
// Token: 0x04006715 RID: 26389
[FieldOffset(Offset = "0x8")]
[Token(Token = "0x4006715")]
public readonly byte[] BinaryMessage;
// Token: 0x04006716 RID: 26390
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006716")]
public readonly string TextMessage;
}
// Token: 0x0200198F RID: 6543
[Token(Token = "0x200198F")]
private struct InboundMessage
{
// Token: 0x0600987F RID: 39039 RVA: 0x001F1CA0 File Offset: 0x001EFEA0
[Token(Token = "0x600987F")]
[Address(RVA = "0x62ADF0", Offset = "0x629DF0", VA = "0x18062ADF0")]
public InboundMessage(byte[] binaryMessage)
{
this.BinaryMessage = binaryMessage;
int num = 0;
int num2 = 0;
this.TextMessage = num2;
this.CloseStatus = num;
this.CloseStatusDescription = num2;
}
// Token: 0x06009880 RID: 39040 RVA: 0x001F1CD0 File Offset: 0x001EFED0
[Token(Token = "0x6009880")]
[Address(RVA = "0x62ADD0", Offset = "0x629DD0", VA = "0x18062ADD0")]
public InboundMessage(string textMessage)
{
int num = 0;
this.TextMessage = textMessage;
int num2 = 0;
this.MessageType = (WebSocketMessageType)num;
this.BinaryMessage = num;
this.CloseStatus = num2;
this.CloseStatusDescription = num;
}
// Token: 0x06009881 RID: 39041 RVA: 0x001F1D04 File Offset: 0x001EFF04
[Token(Token = "0x6009881")]
[Address(RVA = "0x62AE10", Offset = "0x629E10", VA = "0x18062AE10")]
public InboundMessage(WebSocketCloseStatus? closeStatus, string closeStatusDescription)
{
int num = 0;
this.BinaryMessage = num;
this.TextMessage = num;
this.CloseStatus = closeStatus;
this.CloseStatusDescription = closeStatusDescription;
}
// Token: 0x04006717 RID: 26391
[FieldOffset(Offset = "0x0")]
[Token(Token = "0x4006717")]
public readonly WebSocketMessageType MessageType;
// Token: 0x04006718 RID: 26392
[FieldOffset(Offset = "0x8")]
[Token(Token = "0x4006718")]
public readonly byte[] BinaryMessage;
// Token: 0x04006719 RID: 26393
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006719")]
public readonly string TextMessage;
// Token: 0x0400671A RID: 26394
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x400671A")]
public readonly WebSocketCloseStatus? CloseStatus;
// Token: 0x0400671B RID: 26395
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x400671B")]
public readonly string CloseStatusDescription;
}
// Token: 0x02001990 RID: 6544
[Token(Token = "0x2001990")]
public sealed class OnWebSocketOpenDelegate : MulticastDelegate
{
// Token: 0x06009882 RID: 39042 RVA: 0x001F1D30 File Offset: 0x001EFF30
[Token(Token = "0x6009882")]
[Address(RVA = "0x4AF020", Offset = "0x4AE020", VA = "0x1804AF020")]
public OnWebSocketOpenDelegate(object @object, IntPtr method)
{
this.method = method;
this.m_target = @object;
}
// Token: 0x06009883 RID: 39043 RVA: 0x001F1D4C File Offset: 0x001EFF4C
[Token(Token = "0x6009883")]
[Address(RVA = "0x5FA230", Offset = "0x5F9230", VA = "0x1805FA230", Slot = "13")]
public void Invoke(NativeWebSocket webSocket)
{
if (this.delegates != 0)
{
}
uint num;
if (num != (uint)0)
{
throw new ExecutionEngineException();
}
}
// Token: 0x06009884 RID: 39044 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009884")]
[Address(RVA = "0x5FA200", Offset = "0x5F9200", VA = "0x1805FA200", Slot = "14")]
public IAsyncResult BeginInvoke(NativeWebSocket webSocket, AsyncCallback callback, object @object)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06009885 RID: 39045 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009885")]
[Address(RVA = "0x4F56B0", Offset = "0x4F46B0", VA = "0x1804F56B0", Slot = "15")]
public void EndInvoke(IAsyncResult result)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
// Token: 0x02001991 RID: 6545
[Token(Token = "0x2001991")]
public sealed class OnWebSocketMessageDelegate : MulticastDelegate
{
// Token: 0x06009886 RID: 39046 RVA: 0x001F1E00 File Offset: 0x001F0000
[Token(Token = "0x6009886")]
[Address(RVA = "0x4AF020", Offset = "0x4AE020", VA = "0x1804AF020")]
public OnWebSocketMessageDelegate(object @object, IntPtr method)
{
this.method = method;
this.m_target = @object;
}
// Token: 0x06009887 RID: 39047 RVA: 0x001F1E1C File Offset: 0x001F001C
[Token(Token = "0x6009887")]
[Address(RVA = "0x62E170", Offset = "0x62D170", VA = "0x18062E170", Slot = "13")]
public void Invoke(NativeWebSocket webSocket, string message)
{
if (this.delegates != 0)
{
}
uint num;
if (num != (uint)0)
{
throw new ExecutionEngineException();
}
}
// Token: 0x06009888 RID: 39048 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009888")]
[Address(RVA = "0x52CC60", Offset = "0x52BC60", VA = "0x18052CC60", Slot = "14")]
public IAsyncResult BeginInvoke(NativeWebSocket webSocket, string message, AsyncCallback callback, object @object)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06009889 RID: 39049 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009889")]
[Address(RVA = "0x4F56B0", Offset = "0x4F46B0", VA = "0x1804F56B0", Slot = "15")]
public void EndInvoke(IAsyncResult result)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
// Token: 0x02001992 RID: 6546
[Token(Token = "0x2001992")]
public sealed class OnWebSocketBinaryDelegate : MulticastDelegate
{
// Token: 0x0600988A RID: 39050 RVA: 0x001F1E9C File Offset: 0x001F009C
[Token(Token = "0x600988A")]
[Address(RVA = "0x4AF020", Offset = "0x4AE020", VA = "0x1804AF020")]
public OnWebSocketBinaryDelegate(object @object, IntPtr method)
{
this.method = method;
this.m_target = @object;
}
// Token: 0x0600988B RID: 39051 RVA: 0x001F1EB8 File Offset: 0x001F00B8
[Token(Token = "0x600988B")]
[Address(RVA = "0x62D840", Offset = "0x62C840", VA = "0x18062D840", Slot = "13")]
public void Invoke(NativeWebSocket webSocket, byte[] data)
{
if (this.delegates != 0)
{
}
uint num;
if (num != (uint)0)
{
throw new ExecutionEngineException();
}
}
// Token: 0x0600988C RID: 39052 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600988C")]
[Address(RVA = "0x52CC60", Offset = "0x52BC60", VA = "0x18052CC60", Slot = "14")]
public IAsyncResult BeginInvoke(NativeWebSocket webSocket, byte[] data, AsyncCallback callback, object @object)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600988D RID: 39053 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600988D")]
[Address(RVA = "0x4F56B0", Offset = "0x4F46B0", VA = "0x1804F56B0", Slot = "15")]
public void EndInvoke(IAsyncResult result)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
// Token: 0x02001993 RID: 6547
[Token(Token = "0x2001993")]
public sealed class OnWebSocketClosedDelegate : MulticastDelegate
{
// Token: 0x0600988E RID: 39054 RVA: 0x001F1F80 File Offset: 0x001F0180
[Token(Token = "0x600988E")]
[Address(RVA = "0x4AF020", Offset = "0x4AE020", VA = "0x1804AF020")]
public OnWebSocketClosedDelegate(object @object, IntPtr method)
{
this.method = method;
this.m_target = @object;
}
// Token: 0x0600988F RID: 39055 RVA: 0x001F1F9C File Offset: 0x001F019C
[Token(Token = "0x600988F")]
[Address(RVA = "0x62DD30", Offset = "0x62CD30", VA = "0x18062DD30", Slot = "13")]
public void Invoke(NativeWebSocket webSocket, ushort code, string message)
{
if (this.delegates != 0)
{
}
uint num;
if (num != (uint)0)
{
throw new ExecutionEngineException();
}
}
// Token: 0x06009890 RID: 39056 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009890")]
[Address(RVA = "0x62DBF0", Offset = "0x62CBF0", VA = "0x18062DBF0", Slot = "14")]
public IAsyncResult BeginInvoke(NativeWebSocket webSocket, ushort code, string message, AsyncCallback callback, object @object)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06009891 RID: 39057 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009891")]
[Address(RVA = "0x4F56B0", Offset = "0x4F46B0", VA = "0x1804F56B0", Slot = "15")]
public void EndInvoke(IAsyncResult result)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
// Token: 0x02001994 RID: 6548
[Token(Token = "0x2001994")]
public sealed class OnWebSocketErrorDelegate : MulticastDelegate
{
// Token: 0x06009892 RID: 39058 RVA: 0x001F2040 File Offset: 0x001F0240
[Token(Token = "0x6009892")]
[Address(RVA = "0x4AF020", Offset = "0x4AE020", VA = "0x1804AF020")]
public OnWebSocketErrorDelegate(object @object, IntPtr method)
{
this.method = method;
this.m_target = @object;
}
// Token: 0x06009893 RID: 39059 RVA: 0x001F205C File Offset: 0x001F025C
[Token(Token = "0x6009893")]
[Address(RVA = "0x62D840", Offset = "0x62C840", VA = "0x18062D840", Slot = "13")]
public void Invoke(NativeWebSocket webSocket, Exception ex)
{
if (this.delegates != 0)
{
}
uint num;
if (num != (uint)0)
{
throw new ExecutionEngineException();
}
}
// Token: 0x06009894 RID: 39060 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009894")]
[Address(RVA = "0x52CC60", Offset = "0x52BC60", VA = "0x18052CC60", Slot = "14")]
public IAsyncResult BeginInvoke(NativeWebSocket webSocket, Exception ex, AsyncCallback callback, object @object)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06009895 RID: 39061 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009895")]
[Address(RVA = "0x4F56B0", Offset = "0x4F46B0", VA = "0x1804F56B0", Slot = "15")]
public void EndInvoke(IAsyncResult result)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
// Token: 0x02001995 RID: 6549
[Token(Token = "0x2001995")]
public sealed class OnWebSocketErrorDescriptionDelegate : MulticastDelegate
{
// Token: 0x06009896 RID: 39062 RVA: 0x001F2120 File Offset: 0x001F0320
[Token(Token = "0x6009896")]
[Address(RVA = "0x4AF020", Offset = "0x4AE020", VA = "0x1804AF020")]
public OnWebSocketErrorDescriptionDelegate(object @object, IntPtr method)
{
this.method = method;
this.m_target = @object;
}
// Token: 0x06009897 RID: 39063 RVA: 0x001F213C File Offset: 0x001F033C
[Token(Token = "0x6009897")]
[Address(RVA = "0x62E170", Offset = "0x62D170", VA = "0x18062E170", Slot = "13")]
public void Invoke(NativeWebSocket webSocket, string reason)
{
if (this.delegates != 0)
{
}
uint num;
if (num != (uint)0)
{
throw new ExecutionEngineException();
}
}
// Token: 0x06009898 RID: 39064 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009898")]
[Address(RVA = "0x52CC60", Offset = "0x52BC60", VA = "0x18052CC60", Slot = "14")]
public IAsyncResult BeginInvoke(NativeWebSocket webSocket, string reason, AsyncCallback callback, object @object)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06009899 RID: 39065 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6009899")]
[Address(RVA = "0x4F56B0", Offset = "0x4F46B0", VA = "0x1804F56B0", Slot = "15")]
public void EndInvoke(IAsyncResult result)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
// Token: 0x02001996 RID: 6550
[Token(Token = "0x2001996")]
public static class WaitHandleAsyncFactory
{
// Token: 0x0600989A RID: 39066 RVA: 0x001F21BC File Offset: 0x001F03BC
[Token(Token = "0x600989A")]
[Address(RVA = "0x633B70", Offset = "0x632B70", VA = "0x180633B70")]
public static Task FromWaitHandle(WaitHandle handle)
{
/*
An exception occurred when decompiling this method (0600989A)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Threading.Tasks.Task BestHTTP.WebSocket.NativeWebSocket/WaitHandleAsyncFactory::FromWaitHandle(System.Threading.WaitHandle)
---> System.Exception: Basic block has to end with unconditional control flow.
{
Block_0:
stloc:XmlSchemaWhiteSpace(var_0_06, callgetter:XmlSchemaWhiteSpace(Datatype_anyAtomicType::get_BuiltInWhitespaceFacet, ldc.i4:int32[exp:Datatype_anyAtomicType](0)))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600989B RID: 39067 RVA: 0x001F21D0 File Offset: 0x001F03D0
[Token(Token = "0x600989B")]
[Address(RVA = "0x633800", Offset = "0x632800", VA = "0x180633800")]
public static Task<bool> FromWaitHandle(WaitHandle handle, TimeSpan timeout)
{
XmlSchemaWhiteSpace builtInWhitespaceFacet = 0.BuiltInWhitespaceFacet;
Task<bool> task;
return task;
}
// Token: 0x0600989C RID: 39068 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600989C")]
[Address(RVA = "0x633760", Offset = "0x632760", VA = "0x180633760")]
public static Task FromWaitHandle(WaitHandle handle, CancellationToken token)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600989D RID: 39069 RVA: 0x001F21E8 File Offset: 0x001F03E8
[Token(Token = "0x600989D")]
[Address(RVA = "0x6338A0", Offset = "0x6328A0", VA = "0x1806338A0")]
public static Task<bool> FromWaitHandle(WaitHandle handle, TimeSpan timeout, CancellationToken token)
{
/*
An exception occurred when decompiling this method (0600989D)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Threading.Tasks.Task`1<System.Boolean> BestHTTP.WebSocket.NativeWebSocket/WaitHandleAsyncFactory::FromWaitHandle(System.Threading.WaitHandle,System.TimeSpan,System.Threading.CancellationToken)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_3D:
stloc:ArgumentNullException(var_8_47, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("handle")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x0600989E RID: 39070 RVA: 0x001F2240 File Offset: 0x001F0440
[Token(Token = "0x600989E")]
[Address(RVA = "0x633660", Offset = "0x632660", VA = "0x180633660")]
private static Task<bool> DoFromWaitHandle(WaitHandle handle, TimeSpan timeout, CancellationToken token)
{
AsyncTaskMethodBuilder asyncTaskMethodBuilder = AsyncTaskMethodBuilder.Create();
Task task;
return task;
}
// Token: 0x0600989F RID: 39071 RVA: 0x001F2258 File Offset: 0x001F0458
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600989F")]
[Address(RVA = "0x633C40", Offset = "0x632C40", VA = "0x180633C40")]
static WaitHandleAsyncFactory()
{
Task<bool> task = Task.FromResult<bool>(true);
int num = 0;
NativeWebSocket.WaitHandleAsyncFactory.CompletedTaskTrue = task;
NativeWebSocket.WaitHandleAsyncFactory.CompletedTaskFalse = Task.FromResult<bool>(num != 0);
Task<bool> task2;
NativeWebSocket.WaitHandleAsyncFactory.CancelledTask = task2;
}
// Token: 0x0400671C RID: 26396
[Token(Token = "0x400671C")]
private static Task<bool> CompletedTaskTrue;
// Token: 0x0400671D RID: 26397
[Token(Token = "0x400671D")]
private static Task<bool> CompletedTaskFalse;
// Token: 0x0400671E RID: 26398
[Token(Token = "0x400671E")]
private static Task<bool> CancelledTask;
// Token: 0x02001997 RID: 6551
[Token(Token = "0x2001997")]
private sealed class ThreadPoolRegistration : IDisposable
{
// Token: 0x060098A0 RID: 39072 RVA: 0x000399F2 File Offset: 0x00037BF2
[Token(Token = "0x60098A0")]
[Address(RVA = "0x630560", Offset = "0x62F560", VA = "0x180630560")]
public ThreadPoolRegistration(WaitHandle handle, TimeSpan timeout, TaskCompletionSource<bool> tcs)
{
}
// Token: 0x060098A1 RID: 39073 RVA: 0x000399F2 File Offset: 0x00037BF2
[Token(Token = "0x60098A1")]
[Address(RVA = "0x630530", Offset = "0x62F530", VA = "0x180630530", Slot = "4")]
void IDisposable.Dispose()
{
}
// Token: 0x0400671F RID: 26399
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x400671F")]
private readonly RegisteredWaitHandle _registeredWaitHandle;
}
}
}
}
@@ -0,0 +1,50 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket
{
// Token: 0x020019A4 RID: 6564
[Token(Token = "0x20019A4")]
public sealed class OnWebSocketBinaryDelegate : MulticastDelegate
{
// Token: 0x060098BE RID: 39102 RVA: 0x001F2D28 File Offset: 0x001F0F28
[Token(Token = "0x60098BE")]
[Address(RVA = "0x4AF020", Offset = "0x4AE020", VA = "0x1804AF020")]
public OnWebSocketBinaryDelegate(object @object, IntPtr method)
{
this.method = method;
this.m_target = @object;
}
// Token: 0x060098BF RID: 39103 RVA: 0x001F2D44 File Offset: 0x001F0F44
[Token(Token = "0x60098BF")]
[Address(RVA = "0x62D840", Offset = "0x62C840", VA = "0x18062D840", Slot = "13")]
public void Invoke(WebSocket webSocket, byte[] data)
{
if (this.delegates != 0)
{
}
uint num;
if (num != (uint)0)
{
throw new ExecutionEngineException();
}
}
// Token: 0x060098C0 RID: 39104 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098C0")]
[Address(RVA = "0x52CC60", Offset = "0x52BC60", VA = "0x18052CC60", Slot = "14")]
public IAsyncResult BeginInvoke(WebSocket webSocket, byte[] data, AsyncCallback callback, object @object)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060098C1 RID: 39105 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098C1")]
[Address(RVA = "0x4F56B0", Offset = "0x4F46B0", VA = "0x1804F56B0", Slot = "15")]
public void EndInvoke(IAsyncResult result)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
}
@@ -0,0 +1,50 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket
{
// Token: 0x020019A5 RID: 6565
[Token(Token = "0x20019A5")]
public sealed class OnWebSocketClosedDelegate : MulticastDelegate
{
// Token: 0x060098C2 RID: 39106 RVA: 0x001F2E0C File Offset: 0x001F100C
[Token(Token = "0x60098C2")]
[Address(RVA = "0x4AF020", Offset = "0x4AE020", VA = "0x1804AF020")]
public OnWebSocketClosedDelegate(object @object, IntPtr method)
{
this.method = method;
this.m_target = @object;
}
// Token: 0x060098C3 RID: 39107 RVA: 0x001F2E28 File Offset: 0x001F1028
[Token(Token = "0x60098C3")]
[Address(RVA = "0x62DD30", Offset = "0x62CD30", VA = "0x18062DD30", Slot = "13")]
public void Invoke(WebSocket webSocket, ushort code, string message)
{
if (this.delegates != 0)
{
}
uint num;
if (num != (uint)0)
{
throw new ExecutionEngineException();
}
}
// Token: 0x060098C4 RID: 39108 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098C4")]
[Address(RVA = "0x62DC90", Offset = "0x62CC90", VA = "0x18062DC90", Slot = "14")]
public IAsyncResult BeginInvoke(WebSocket webSocket, ushort code, string message, AsyncCallback callback, object @object)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060098C5 RID: 39109 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098C5")]
[Address(RVA = "0x4F56B0", Offset = "0x4F46B0", VA = "0x1804F56B0", Slot = "15")]
public void EndInvoke(IAsyncResult result)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
}
@@ -0,0 +1,50 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket
{
// Token: 0x020019A6 RID: 6566
[Token(Token = "0x20019A6")]
public sealed class OnWebSocketErrorDelegate : MulticastDelegate
{
// Token: 0x060098C6 RID: 39110 RVA: 0x001F2ECC File Offset: 0x001F10CC
[Token(Token = "0x60098C6")]
[Address(RVA = "0x4AF020", Offset = "0x4AE020", VA = "0x1804AF020")]
public OnWebSocketErrorDelegate(object @object, IntPtr method)
{
this.method = method;
this.m_target = @object;
}
// Token: 0x060098C7 RID: 39111 RVA: 0x001F2EE8 File Offset: 0x001F10E8
[Token(Token = "0x60098C7")]
[Address(RVA = "0x62D840", Offset = "0x62C840", VA = "0x18062D840", Slot = "13")]
public void Invoke(WebSocket webSocket, Exception ex)
{
if (this.delegates != 0)
{
}
uint num;
if (num != (uint)0)
{
throw new ExecutionEngineException();
}
}
// Token: 0x060098C8 RID: 39112 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098C8")]
[Address(RVA = "0x52CC60", Offset = "0x52BC60", VA = "0x18052CC60", Slot = "14")]
public IAsyncResult BeginInvoke(WebSocket webSocket, Exception ex, AsyncCallback callback, object @object)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060098C9 RID: 39113 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098C9")]
[Address(RVA = "0x4F56B0", Offset = "0x4F46B0", VA = "0x1804F56B0", Slot = "15")]
public void EndInvoke(IAsyncResult result)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
}
@@ -0,0 +1,50 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket
{
// Token: 0x020019A7 RID: 6567
[Token(Token = "0x20019A7")]
public sealed class OnWebSocketErrorDescriptionDelegate : MulticastDelegate
{
// Token: 0x060098CA RID: 39114 RVA: 0x001F2FAC File Offset: 0x001F11AC
[Token(Token = "0x60098CA")]
[Address(RVA = "0x4AF020", Offset = "0x4AE020", VA = "0x1804AF020")]
public OnWebSocketErrorDescriptionDelegate(object @object, IntPtr method)
{
this.method = method;
this.m_target = @object;
}
// Token: 0x060098CB RID: 39115 RVA: 0x001F2FC8 File Offset: 0x001F11C8
[Token(Token = "0x60098CB")]
[Address(RVA = "0x62E170", Offset = "0x62D170", VA = "0x18062E170", Slot = "13")]
public void Invoke(WebSocket webSocket, string reason)
{
if (this.delegates != 0)
{
}
uint num;
if (num != (uint)0)
{
throw new ExecutionEngineException();
}
}
// Token: 0x060098CC RID: 39116 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098CC")]
[Address(RVA = "0x52CC60", Offset = "0x52BC60", VA = "0x18052CC60", Slot = "14")]
public IAsyncResult BeginInvoke(WebSocket webSocket, string reason, AsyncCallback callback, object @object)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060098CD RID: 39117 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098CD")]
[Address(RVA = "0x4F56B0", Offset = "0x4F46B0", VA = "0x1804F56B0", Slot = "15")]
public void EndInvoke(IAsyncResult result)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
}
@@ -0,0 +1,51 @@
using System;
using BestHTTP.WebSocket.Frames;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket
{
// Token: 0x020019A8 RID: 6568
[Token(Token = "0x20019A8")]
public sealed class OnWebSocketIncompleteFrameDelegate : MulticastDelegate
{
// Token: 0x060098CE RID: 39118 RVA: 0x001F3048 File Offset: 0x001F1248
[Token(Token = "0x60098CE")]
[Address(RVA = "0x4AF020", Offset = "0x4AE020", VA = "0x1804AF020")]
public OnWebSocketIncompleteFrameDelegate(object @object, IntPtr method)
{
this.method = method;
this.m_target = @object;
}
// Token: 0x060098CF RID: 39119 RVA: 0x001F3064 File Offset: 0x001F1264
[Token(Token = "0x60098CF")]
[Address(RVA = "0x62E4A0", Offset = "0x62D4A0", VA = "0x18062E4A0", Slot = "13")]
public void Invoke(WebSocket webSocket, WebSocketFrameReader frame)
{
if (this.delegates != 0)
{
}
uint num;
if (num != (uint)0)
{
throw new ExecutionEngineException();
}
}
// Token: 0x060098D0 RID: 39120 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098D0")]
[Address(RVA = "0x62E410", Offset = "0x62D410", VA = "0x18062E410", Slot = "14")]
public IAsyncResult BeginInvoke(WebSocket webSocket, WebSocketFrameReader frame, AsyncCallback callback, object @object)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060098D1 RID: 39121 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098D1")]
[Address(RVA = "0x4F56B0", Offset = "0x4F46B0", VA = "0x1804F56B0", Slot = "15")]
public void EndInvoke(IAsyncResult result)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
}
@@ -0,0 +1,50 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket
{
// Token: 0x020019A3 RID: 6563
[Token(Token = "0x20019A3")]
public sealed class OnWebSocketMessageDelegate : MulticastDelegate
{
// Token: 0x060098BA RID: 39098 RVA: 0x001F2C8C File Offset: 0x001F0E8C
[Token(Token = "0x60098BA")]
[Address(RVA = "0x4AF020", Offset = "0x4AE020", VA = "0x1804AF020")]
public OnWebSocketMessageDelegate(object @object, IntPtr method)
{
this.method = method;
this.m_target = @object;
}
// Token: 0x060098BB RID: 39099 RVA: 0x001F2CA8 File Offset: 0x001F0EA8
[Token(Token = "0x60098BB")]
[Address(RVA = "0x62E170", Offset = "0x62D170", VA = "0x18062E170", Slot = "13")]
public void Invoke(WebSocket webSocket, string message)
{
if (this.delegates != 0)
{
}
uint num;
if (num != (uint)0)
{
throw new ExecutionEngineException();
}
}
// Token: 0x060098BC RID: 39100 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098BC")]
[Address(RVA = "0x52CC60", Offset = "0x52BC60", VA = "0x18052CC60", Slot = "14")]
public IAsyncResult BeginInvoke(WebSocket webSocket, string message, AsyncCallback callback, object @object)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060098BD RID: 39101 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098BD")]
[Address(RVA = "0x4F56B0", Offset = "0x4F46B0", VA = "0x1804F56B0", Slot = "15")]
public void EndInvoke(IAsyncResult result)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
}
@@ -0,0 +1,50 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket
{
// Token: 0x020019A2 RID: 6562
[Token(Token = "0x20019A2")]
public sealed class OnWebSocketOpenDelegate : MulticastDelegate
{
// Token: 0x060098B6 RID: 39094 RVA: 0x001F2BE4 File Offset: 0x001F0DE4
[Token(Token = "0x60098B6")]
[Address(RVA = "0x4AF020", Offset = "0x4AE020", VA = "0x1804AF020")]
public OnWebSocketOpenDelegate(object @object, IntPtr method)
{
this.method = method;
this.m_target = @object;
}
// Token: 0x060098B7 RID: 39095 RVA: 0x001F2C00 File Offset: 0x001F0E00
[Token(Token = "0x60098B7")]
[Address(RVA = "0x62EAE0", Offset = "0x62DAE0", VA = "0x18062EAE0", Slot = "13")]
public void Invoke(WebSocket webSocket)
{
if (this.delegates != 0)
{
}
uint num;
if (num != (uint)0)
{
throw new ExecutionEngineException();
}
}
// Token: 0x060098B8 RID: 39096 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098B8")]
[Address(RVA = "0x5FA200", Offset = "0x5F9200", VA = "0x1805FA200", Slot = "14")]
public IAsyncResult BeginInvoke(WebSocket webSocket, AsyncCallback callback, object @object)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x060098B9 RID: 39097 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x60098B9")]
[Address(RVA = "0x4F56B0", Offset = "0x4F46B0", VA = "0x1804F56B0", Slot = "15")]
public void EndInvoke(IAsyncResult result)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
}
}
@@ -0,0 +1,648 @@
using System;
using System.Text;
using System.Threading;
using BestHTTP.Decompression.Zlib;
using BestHTTP.Extensions;
using BestHTTP.Logger;
using BestHTTP.WebSocket.Extensions;
using BestHTTP.WebSocket.Frames;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket
{
// Token: 0x020019A9 RID: 6569
[Token(Token = "0x20019A9")]
public sealed class WebSocket
{
// Token: 0x17001847 RID: 6215
// (get) Token: 0x060098D2 RID: 39122 RVA: 0x001F318C File Offset: 0x001F138C
// (set) Token: 0x060098D3 RID: 39123 RVA: 0x001F31A0 File Offset: 0x001F13A0
[Token(Token = "0x17001847")]
public WebSocketStates State
{
[Token(Token = "0x60098D2")]
[Address(RVA = "0x4944B0", Offset = "0x4934B0", VA = "0x1804944B0")]
get;
[Token(Token = "0x60098D3")]
[Address(RVA = "0x62ADC0", Offset = "0x629DC0", VA = "0x18062ADC0")]
private set;
}
// Token: 0x17001848 RID: 6216
// (get) Token: 0x060098D4 RID: 39124 RVA: 0x001F31B4 File Offset: 0x001F13B4
[Token(Token = "0x17001848")]
public bool IsOpen
{
[Token(Token = "0x60098D4")]
[Address(RVA = "0x63B820", Offset = "0x63A820", VA = "0x18063B820")]
get
{
WebSocketResponse webSocketResponse = this.webSocket;
if (webSocketResponse == 0)
{
}
return !webSocketResponse.closed;
}
}
// Token: 0x17001849 RID: 6217
// (get) Token: 0x060098D5 RID: 39125 RVA: 0x001F31D8 File Offset: 0x001F13D8
[Token(Token = "0x17001849")]
public int BufferedAmount
{
[Token(Token = "0x60098D5")]
[Address(RVA = "0x63B800", Offset = "0x63A800", VA = "0x18063B800")]
get
{
return this.webSocket._bufferedAmount;
}
}
// Token: 0x1700184A RID: 6218
// (get) Token: 0x060098D6 RID: 39126 RVA: 0x001F31F8 File Offset: 0x001F13F8
// (set) Token: 0x060098D7 RID: 39127 RVA: 0x001F320C File Offset: 0x001F140C
[Token(Token = "0x1700184A")]
public bool StartPingThread
{
[Token(Token = "0x60098D6")]
[Address(RVA = "0x498E20", Offset = "0x497E20", VA = "0x180498E20")]
get;
[Token(Token = "0x60098D7")]
[Address(RVA = "0x62FA00", Offset = "0x62EA00", VA = "0x18062FA00")]
set;
}
// Token: 0x1700184B RID: 6219
// (get) Token: 0x060098D8 RID: 39128 RVA: 0x001F3220 File Offset: 0x001F1420
// (set) Token: 0x060098D9 RID: 39129 RVA: 0x001F3234 File Offset: 0x001F1434
[Token(Token = "0x1700184B")]
public int PingFrequency
{
[Token(Token = "0x60098D8")]
[Address(RVA = "0x4936D0", Offset = "0x4926D0", VA = "0x1804936D0")]
get;
[Token(Token = "0x60098D9")]
[Address(RVA = "0x5F1920", Offset = "0x5F0920", VA = "0x1805F1920")]
set;
}
// Token: 0x1700184C RID: 6220
// (get) Token: 0x060098DA RID: 39130 RVA: 0x001F3248 File Offset: 0x001F1448
// (set) Token: 0x060098DB RID: 39131 RVA: 0x001F325C File Offset: 0x001F145C
[Token(Token = "0x1700184C")]
public TimeSpan CloseAfterNoMesssage
{
[Token(Token = "0x60098DA")]
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")]
get;
[Token(Token = "0x60098DB")]
[Address(RVA = "0x4157F0", Offset = "0x4147F0", VA = "0x1804157F0")]
set;
}
// Token: 0x1700184D RID: 6221
// (get) Token: 0x060098DC RID: 39132 RVA: 0x001F3270 File Offset: 0x001F1470
// (set) Token: 0x060098DD RID: 39133 RVA: 0x001F3284 File Offset: 0x001F1484
[Token(Token = "0x1700184D")]
public HTTPRequest InternalRequest
{
[Token(Token = "0x60098DC")]
[Address(RVA = "0x4157C0", Offset = "0x4147C0", VA = "0x1804157C0")]
get;
[Token(Token = "0x60098DD")]
[Address(RVA = "0x415810", Offset = "0x414810", VA = "0x180415810")]
private set;
}
// Token: 0x1700184E RID: 6222
// (get) Token: 0x060098DE RID: 39134 RVA: 0x001F3298 File Offset: 0x001F1498
// (set) Token: 0x060098DF RID: 39135 RVA: 0x001F32AC File Offset: 0x001F14AC
[Token(Token = "0x1700184E")]
public IExtension[] Extensions
{
[Token(Token = "0x60098DE")]
[Address(RVA = "0x4157D0", Offset = "0x4147D0", VA = "0x1804157D0")]
get;
[Token(Token = "0x60098DF")]
[Address(RVA = "0x415820", Offset = "0x414820", VA = "0x180415820")]
private set;
}
// Token: 0x1700184F RID: 6223
// (get) Token: 0x060098E0 RID: 39136 RVA: 0x001F32C0 File Offset: 0x001F14C0
[Token(Token = "0x1700184F")]
public int Latency
{
[Token(Token = "0x60098E0")]
[Address(RVA = "0x63B860", Offset = "0x63A860", VA = "0x18063B860")]
get
{
return this.webSocket.<Latency>k__BackingField;
}
}
// Token: 0x060098E1 RID: 39137 RVA: 0x001F32E0 File Offset: 0x001F14E0
[Token(Token = "0x60098E1")]
[Address(RVA = "0x63AD80", Offset = "0x639D80", VA = "0x18063AD80")]
public WebSocket(Uri uri)
{
string empty = string.Empty;
IExtension[] array = new IExtension[1];
int num = 0;
PerMessageCompression perMessageCompression;
perMessageCompression.FieldGetter(num, empty, empty);
perMessageCompression.<Level>k__BackingField = (CompressionLevel)((ulong)6L);
perMessageCompression.<ClientNoContextTakeover>k__BackingField = false;
perMessageCompression.<ClientMaxWindowBits>k__BackingField = (int)((ulong)15L);
perMessageCompression.<ServerMaxWindowBits>k__BackingField = (int)((ulong)15L);
perMessageCompression.<MinimumDataLegthToCompress>k__BackingField = (int)((ulong)256L);
array[0] = perMessageCompression;
this.Extensions = array;
}
// Token: 0x060098E2 RID: 39138 RVA: 0x001F3350 File Offset: 0x001F1550
[Token(Token = "0x60098E2")]
[Address(RVA = "0x63AF30", Offset = "0x639F30", VA = "0x18063AF30")]
public WebSocket(Uri uri, string origin, string protocol, params IExtension[] extensions)
{
int num = 0;
base.FieldGetter(num, origin, protocol);
bool flag = HTTPProtocolFactory.IsSecureProtocol(uri);
string text = "ws";
if (flag)
{
text = "wss";
}
if (uri.Port != -1)
{
int port = uri.Port;
}
bool flag2 = text.Equals("wss", StringComparison.OrdinalIgnoreCase);
object[] array = new object[6];
if (text != 0)
{
}
array[0] = text;
if ("://" != 0)
{
}
array[1] = "://";
string host = uri.Host;
if (host != 0)
{
}
array[2] = host;
if (":" != 0)
{
}
array[3] = ":";
int num2;
if (num2 != 0)
{
}
array[4] = num2;
string requestPathAndQueryURL = uri.GetRequestPathAndQueryURL();
if (requestPathAndQueryURL != 0)
{
}
array[5] = requestPathAndQueryURL;
Uri uri2 = new Uri(string.Concat(array));
this.PingFrequency = (int)((ulong)1000L);
TimeSpan timeSpan;
this.CloseAfterNoMesssage = timeSpan;
OnRequestFinishedDelegate onRequestFinishedDelegate = new OnRequestFinishedDelegate(this.OnInternalRequestCallback);
HTTPRequest httprequest = new HTTPRequest(uri2, onRequestFinishedDelegate);
this.InternalRequest = httprequest;
OnRequestFinishedDelegate onRequestFinishedDelegate2 = new OnRequestFinishedDelegate(this.OnInternalRequestUpgraded);
httprequest.OnUpgraded = onRequestFinishedDelegate2;
if (!HTTPProtocolFactory.IsSecureProtocol(uri2) && uri2.Port != 80 && HTTPProtocolFactory.IsSecureProtocol(uri2) && uri2.Port != 443)
{
HTTPRequest httprequest2 = this.<InternalRequest>k__BackingField;
string host2 = uri2.Host;
int port2 = uri2.Port;
string text2 = host2 + ":" + port2;
}
HTTPRequest httprequest3 = this.<InternalRequest>k__BackingField;
string host3 = uri2.Host;
httprequest3.SetHeader("Host", host3);
this.<InternalRequest>k__BackingField.SetHeader("Upgrade", "websocket");
this.<InternalRequest>k__BackingField.SetHeader("Connection", "Upgrade");
HTTPRequest httprequest4 = this.<InternalRequest>k__BackingField;
object[] array2 = new object[4];
array2[0] = this;
HTTPRequest httprequest5 = this.<InternalRequest>k__BackingField;
if (httprequest5 != 0)
{
}
array2[1] = httprequest5;
array2[2] = uri2;
object obj = new object();
if (obj != 0)
{
}
array2[3] = obj;
string secKey = this.GetSecKey(array2);
httprequest4.SetHeader("Sec-WebSocket-Key", secKey);
if (secKey == 0)
{
this.<InternalRequest>k__BackingField.SetHeader("Origin", origin);
}
this.<InternalRequest>k__BackingField.SetHeader("Sec-WebSocket-Version", "13");
if (secKey == 0)
{
this.<InternalRequest>k__BackingField.SetHeader("Sec-WebSocket-Protocol", protocol);
}
this.<InternalRequest>k__BackingField.SetHeader("Cache-Control", "no-cache");
this.<InternalRequest>k__BackingField.SetHeader("Pragma", "no-cache");
HTTPRequest httprequest6 = this.<InternalRequest>k__BackingField;
this.Extensions = 0;
httprequest6.DisableCache = true;
this.<InternalRequest>k__BackingField.<DisableRetry>k__BackingField = true;
this.<InternalRequest>k__BackingField.<TryToMinimizeTCPLatency>k__BackingField = true;
Proxy <Proxy>k__BackingField = HTTPManager.<Proxy>k__BackingField;
if (<Proxy>k__BackingField != 0 && <Proxy>k__BackingField != 0)
{
HTTPProxy httpproxy;
this.<InternalRequest>k__BackingField.<Proxy>k__BackingField = httpproxy;
}
HTTPManager.Setup();
}
// Token: 0x060098E3 RID: 39139 RVA: 0x001F3644 File Offset: 0x001F1844
[Token(Token = "0x60098E3")]
[Address(RVA = "0x63A100", Offset = "0x639100", VA = "0x18063A100")]
private void OnInternalRequestCallback(HTTPRequest req, HTTPResponse resp)
{
int num = 0;
HTTPRequestStates httprequestStates = req.<State>k__BackingField;
if (req != 0)
{
if (req != 0 && req != 0 && req != 0 && httprequestStates != HTTPRequestStates.Queued)
{
return;
}
if (req.<Exception>k__BackingField != 0)
{
Exception innerException = req.<Exception>k__BackingField.InnerException;
string text2;
string text = "Request Finished with Error! " + text2;
}
string empty = string.Empty;
string text3 = "Request Finished with Error! " + empty;
}
if (!resp.IsSuccess)
{
int <StatusCode>k__BackingField = resp.<StatusCode>k__BackingField;
if (<StatusCode>k__BackingField != 101)
{
string <Message>k__BackingField = resp.<Message>k__BackingField;
string dataAsText = resp.DataAsText;
string text4 = string.Format("Request Finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", <StatusCode>k__BackingField, <Message>k__BackingField, dataAsText);
if ((int)this.<State>k__BackingField == num && text4 != 0)
{
OnWebSocketClosedDelegate onClosed = this.OnClosed;
if (onClosed == 0)
{
goto IL_112;
}
uint num2;
onClosed(this, (ushort)num2, "Closed while opening");
}
OnWebSocketErrorDelegate onError = this.OnError;
if (onError != 0)
{
Exception <Exception>k__BackingField = req.<Exception>k__BackingField;
onError(this, <Exception>k__BackingField);
}
OnWebSocketErrorDescriptionDelegate onErrorDesc = this.OnErrorDesc;
if (onErrorDesc != 0)
{
onErrorDesc(this, text4);
}
if (this.OnError == num && this.OnErrorDesc == num)
{
ILogger logger = HTTPManager.Logger;
}
IL_112:
if ((req.isKeepAlive ? 1 : 0) != num || resp == 0 || resp != 0)
{
return;
}
return;
}
}
ILogger logger2 = HTTPManager.Logger;
string text6;
string text5 = string.Format("Request finished. Status Code: {0} Message: {1}", text6, resp);
throw new NullReferenceException();
}
// Token: 0x060098E4 RID: 39140 RVA: 0x001F3794 File Offset: 0x001F1994
[Token(Token = "0x60098E4")]
[Address(RVA = "0x63A430", Offset = "0x639430", VA = "0x18063A430")]
private void OnInternalRequestUpgraded(HTTPRequest req, HTTPResponse resp)
{
int num = 0;
if (resp != 0)
{
}
this.webSocket = num;
WebSocketResponse webSocketResponse6;
WaitCallback waitCallback;
if (num != 0)
{
IExtension[] array = this.<Extensions>k__BackingField;
if (array != 0)
{
int length = array.Length;
if (num < length)
{
if (array[num] != 0 && array == 0)
{
this.<Extensions>k__BackingField[0] = num;
}
ILogger logger = HTTPManager.Logger;
IExtension[] array2 = this.<Extensions>k__BackingField;
int num2 = 0;
array2[0] = num2;
num++;
}
}
this.<State>k__BackingField = (WebSocketStates)((ulong)1L);
if (this.OnOpen != (ulong)0L)
{
this.OnOpen(this);
ILogger logger2 = HTTPManager.Logger;
}
WebSocketResponse webSocketResponse = this.webSocket;
Action<WebSocketResponse, string> action = delegate(WebSocketResponse ws, string msg)
{
OnWebSocketMessageDelegate onMessage = this.OnMessage;
if (onMessage != 0)
{
onMessage(this, msg);
return;
}
};
webSocketResponse.OnText = action;
WebSocketResponse webSocketResponse2 = this.webSocket;
Action<WebSocketResponse, byte[]> action2 = delegate(WebSocketResponse ws, byte[] bin)
{
OnWebSocketBinaryDelegate onBinary = this.OnBinary;
if (onBinary != 0)
{
onBinary(this, bin);
return;
}
};
webSocketResponse2.OnBinary = action2;
WebSocketResponse webSocketResponse3 = this.webSocket;
Action<WebSocketResponse, ushort, string> action3 = delegate(WebSocketResponse ws, ushort code, string msg)
{
OnWebSocketClosedDelegate onClosed = this.OnClosed;
this.<State>k__BackingField = (WebSocketStates)((ulong)3L);
if (onClosed != 0)
{
onClosed(this, code, msg);
return;
}
};
webSocketResponse3.OnClosed = action3;
if (this.OnIncompleteFrame != (ulong)0L)
{
WebSocketResponse webSocketResponse4 = this.webSocket;
Action<WebSocketResponse, WebSocketFrameReader> action4 = delegate(WebSocketResponse ws, WebSocketFrameReader frame)
{
if (this.OnIncompleteFrame != 0)
{
byte[] <Data>k__BackingField = frame.<Data>k__BackingField;
}
};
webSocketResponse4.OnIncompleteFrame = action4;
}
if (this.<StartPingThread>k__BackingField)
{
WebSocketResponse webSocketResponse5 = this.webSocket;
int num3 = Math.Max(this.<PingFrequency>k__BackingField, 100);
webSocketResponse5.StartPinging(num3);
}
webSocketResponse6 = this.webSocket;
waitCallback = new WaitCallback(webSocketResponse6.ReceiveThreadFunc);
bool flag = ThreadPool.QueueUserWorkItem(waitCallback);
return;
}
if (waitCallback.original_method_info != 0)
{
}
if (waitCallback.data != 0 && webSocketResponse6.Stream != 0)
{
bool canRead = webSocketResponse6.Stream.CanRead;
DelegateData data = waitCallback.data;
}
waitCallback.method_ptr = (IntPtr)((ulong)3L);
}
// Token: 0x060098E5 RID: 39141 RVA: 0x001F394C File Offset: 0x001F1B4C
[Token(Token = "0x60098E5")]
[Address(RVA = "0x63A9A0", Offset = "0x6399A0", VA = "0x18063A9A0")]
public void Open()
{
if (!this.requestSent)
{
if (this.<Extensions>k__BackingField != (ulong)0L)
{
int num = 0;
IExtension[] array = this.<Extensions>k__BackingField;
int length = array.Length;
if (num < length)
{
if (array[num] != 0)
{
}
num++;
}
ILogger logger = HTTPManager.Logger;
}
HTTPRequest httprequest = this.<InternalRequest>k__BackingField.Send();
this.requestSent = true;
this.<State>k__BackingField = (WebSocketStates)((ulong)0L);
return;
}
InvalidOperationException ex = new InvalidOperationException("Open already called! You can't reuse this WebSocket instance!");
throw new IndexOutOfRangeException();
}
// Token: 0x060098E6 RID: 39142 RVA: 0x001F39DC File Offset: 0x001F1BDC
[Token(Token = "0x60098E6")]
[Address(RVA = "0x63AB30", Offset = "0x639B30", VA = "0x18063AB30")]
public void Send(string message)
{
WebSocketResponse webSocketResponse = this.webSocket;
if (webSocketResponse != 0 && !webSocketResponse.closed)
{
this.webSocket.Send(message);
}
}
// Token: 0x060098E7 RID: 39143 RVA: 0x001F3A10 File Offset: 0x001F1C10
[Token(Token = "0x60098E7")]
[Address(RVA = "0x63AC70", Offset = "0x639C70", VA = "0x18063AC70")]
public void Send(byte[] buffer)
{
WebSocketResponse webSocketResponse = this.webSocket;
if (webSocketResponse != 0 && !webSocketResponse.closed)
{
this.webSocket.Send(buffer);
}
}
// Token: 0x060098E8 RID: 39144 RVA: 0x001F3A44 File Offset: 0x001F1C44
[Token(Token = "0x60098E8")]
[Address(RVA = "0x63AB90", Offset = "0x639B90", VA = "0x18063AB90")]
public void Send(byte[] buffer, ulong offset, ulong count)
{
WebSocketResponse webSocketResponse = this.webSocket;
if (webSocketResponse != 0 && !webSocketResponse.closed)
{
this.webSocket.Send(buffer, offset, count);
}
}
// Token: 0x060098E9 RID: 39145 RVA: 0x001F3A7C File Offset: 0x001F1C7C
[Token(Token = "0x60098E9")]
[Address(RVA = "0x63AC10", Offset = "0x639C10", VA = "0x18063AC10")]
public void Send(WebSocketFrame frame)
{
WebSocketResponse webSocketResponse = this.webSocket;
if (webSocketResponse != 0 && !webSocketResponse.closed)
{
this.webSocket.Send(frame);
}
}
// Token: 0x060098EA RID: 39146 RVA: 0x001F3AB0 File Offset: 0x001F1CB0
[Token(Token = "0x60098EA")]
[Address(RVA = "0x639C40", Offset = "0x638C40", VA = "0x180639C40")]
public void Close()
{
WebSocketStates webSocketStates = this.<State>k__BackingField;
this.<State>k__BackingField = (WebSocketStates)((ulong)2L);
WebSocketResponse webSocketResponse = this.webSocket;
}
// Token: 0x060098EB RID: 39147 RVA: 0x001F3AF8 File Offset: 0x001F1CF8
[Token(Token = "0x60098EB")]
[Address(RVA = "0x639D00", Offset = "0x638D00", VA = "0x180639D00")]
public void Close(ushort code, string message)
{
WebSocketResponse webSocketResponse = this.webSocket;
if (webSocketResponse != 0 && !webSocketResponse.closed)
{
this.webSocket.Close(code, message);
}
}
// Token: 0x060098EC RID: 39148 RVA: 0x001F3B2C File Offset: 0x001F1D2C
[Token(Token = "0x60098EC")]
[Address(RVA = "0x639D70", Offset = "0x638D70", VA = "0x180639D70")]
public static byte[] EncodeCloseData(ushort code, string message)
{
int num;
byte[] array;
do
{
num = 0;
object obj = Encoding.UTF8.Clone();
byte[] bytes = BitConverter.GetBytes(code);
int length = bytes.Length;
int num2 = 0;
Array.Reverse(bytes, num2, length);
BufferPoolMemoryStream bufferPoolMemoryStream;
int num3 = bufferPoolMemoryStream.ReadByte();
Encoding utf = Encoding.UTF8;
int num4 = bufferPoolMemoryStream.ReadByte();
array = bufferPoolMemoryStream.ToArray();
if (bufferPoolMemoryStream != 0)
{
}
}
while (num != 0);
return array;
}
// Token: 0x060098ED RID: 39149 RVA: 0x001F3BB8 File Offset: 0x001F1DB8
[Token(Token = "0x60098ED")]
[Address(RVA = "0x639F80", Offset = "0x638F80", VA = "0x180639F80")]
private string GetSecKey(object[] from)
{
byte[] array = new byte[16];
int num = 0;
int num2 = 0;
int num3 = 0;
int length = from.Length;
if (num < length)
{
from[num3].Finalize();
int num4 = 0;
byte[] array2;
int length2 = array2.Length;
if (num4 < length2)
{
int length3 = array.Length;
if (num2 < length3)
{
num2++;
num4++;
}
}
num3++;
}
return Convert.ToBase64String(array);
}
// Token: 0x04006760 RID: 26464
[FieldOffset(Offset = "0x30")]
[Token(Token = "0x4006760")]
public OnWebSocketOpenDelegate OnOpen;
// Token: 0x04006761 RID: 26465
[FieldOffset(Offset = "0x38")]
[Token(Token = "0x4006761")]
public OnWebSocketMessageDelegate OnMessage;
// Token: 0x04006762 RID: 26466
[FieldOffset(Offset = "0x40")]
[Token(Token = "0x4006762")]
public OnWebSocketBinaryDelegate OnBinary;
// Token: 0x04006763 RID: 26467
[FieldOffset(Offset = "0x48")]
[Token(Token = "0x4006763")]
public OnWebSocketClosedDelegate OnClosed;
// Token: 0x04006764 RID: 26468
[FieldOffset(Offset = "0x50")]
[Token(Token = "0x4006764")]
public OnWebSocketErrorDelegate OnError;
// Token: 0x04006765 RID: 26469
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x4006765")]
public OnWebSocketErrorDescriptionDelegate OnErrorDesc;
// Token: 0x04006766 RID: 26470
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x4006766")]
public OnWebSocketIncompleteFrameDelegate OnIncompleteFrame;
// Token: 0x04006767 RID: 26471
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x4006767")]
private bool requestSent;
// Token: 0x04006768 RID: 26472
[FieldOffset(Offset = "0x70")]
[Token(Token = "0x4006768")]
private WebSocketResponse webSocket;
}
}
@@ -0,0 +1,895 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using BestHTTP.Extensions;
using BestHTTP.Logger;
using BestHTTP.WebSocket.Frames;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket
{
// Token: 0x020019AA RID: 6570
[Token(Token = "0x20019AA")]
public sealed class WebSocketResponse : HTTPResponse, IHeartbeat, IProtocol
{
// Token: 0x17001850 RID: 6224
// (get) Token: 0x060098F2 RID: 39154 RVA: 0x001F3CBC File Offset: 0x001F1EBC
// (set) Token: 0x060098F3 RID: 39155 RVA: 0x001F3CD0 File Offset: 0x001F1ED0
[Token(Token = "0x17001850")]
public WebSocket WebSocket
{
[Token(Token = "0x60098F2")]
[Address(RVA = "0x44C890", Offset = "0x44B890", VA = "0x18044C890")]
get;
[Token(Token = "0x60098F3")]
[Address(RVA = "0x44E020", Offset = "0x44D020", VA = "0x18044E020")]
internal set;
}
// Token: 0x17001851 RID: 6225
// (get) Token: 0x060098F4 RID: 39156 RVA: 0x001F3CE4 File Offset: 0x001F1EE4
[Token(Token = "0x17001851")]
public bool IsClosed
{
[Token(Token = "0x60098F4")]
[Address(RVA = "0x638310", Offset = "0x637310", VA = "0x180638310", Slot = "7")]
get
{
return this.closed;
}
}
// Token: 0x17001852 RID: 6226
// (get) Token: 0x060098F5 RID: 39157 RVA: 0x001F3CF8 File Offset: 0x001F1EF8
// (set) Token: 0x060098F6 RID: 39158 RVA: 0x001F3D0C File Offset: 0x001F1F0C
[Token(Token = "0x17001852")]
public TimeSpan PingFrequnecy
{
[Token(Token = "0x60098F5")]
[Address(RVA = "0x44BF00", Offset = "0x44AF00", VA = "0x18044BF00")]
get;
[Token(Token = "0x60098F6")]
[Address(RVA = "0x42DB80", Offset = "0x42CB80", VA = "0x18042DB80")]
private set;
}
// Token: 0x17001853 RID: 6227
// (get) Token: 0x060098F7 RID: 39159 RVA: 0x001F3D20 File Offset: 0x001F1F20
// (set) Token: 0x060098F8 RID: 39160 RVA: 0x001F3D34 File Offset: 0x001F1F34
[Token(Token = "0x17001853")]
public ushort MaxFragmentSize
{
[Token(Token = "0x60098F7")]
[Address(RVA = "0x638330", Offset = "0x637330", VA = "0x180638330")]
get;
[Token(Token = "0x60098F8")]
[Address(RVA = "0x638340", Offset = "0x637340", VA = "0x180638340")]
private set;
}
// Token: 0x17001854 RID: 6228
// (get) Token: 0x060098F9 RID: 39161 RVA: 0x001F3D48 File Offset: 0x001F1F48
[Token(Token = "0x17001854")]
public int BufferedAmount
{
[Token(Token = "0x60098F9")]
[Address(RVA = "0x5BF050", Offset = "0x5BE050", VA = "0x1805BF050")]
get
{
return this._bufferedAmount;
}
}
// Token: 0x17001855 RID: 6229
// (get) Token: 0x060098FA RID: 39162 RVA: 0x001F3D5C File Offset: 0x001F1F5C
// (set) Token: 0x060098FB RID: 39163 RVA: 0x001F3D70 File Offset: 0x001F1F70
[Token(Token = "0x17001855")]
public int Latency
{
[Token(Token = "0x60098FA")]
[Address(RVA = "0x5BF060", Offset = "0x5BE060", VA = "0x1805BF060")]
get;
[Token(Token = "0x60098FB")]
[Address(RVA = "0x5BF280", Offset = "0x5BE280", VA = "0x1805BF280")]
private set;
}
// Token: 0x060098FC RID: 39164 RVA: 0x001F3D84 File Offset: 0x001F1F84
[Token(Token = "0x60098FC")]
[Address(RVA = "0x6380D0", Offset = "0x6370D0", VA = "0x1806380D0")]
internal WebSocketResponse(HTTPRequest request, Stream stream, bool isStreamed, bool isFromCache)
{
List<WebSocketFrameReader> list = new List();
this.IncompleteFrames = list;
List<WebSocketFrameReader> list2 = new List();
this.CompletedFrames = list2;
List<WebSocketFrameReader> list3 = new List();
this.frameCache = list3;
object obj = new object();
this.FrameLock = obj;
object obj2 = new object();
this.SendLock = obj2;
List<WebSocketFrame> list4 = new List();
this.unsentFrames = list4;
int num;
AutoResetEvent autoResetEvent = new AutoResetEvent(num != 0);
num = 0;
this.newFrameSignal = autoResetEvent;
DateTime minValue = DateTime.MinValue;
this.lastPing = minValue;
DateTime minValue2 = DateTime.MinValue;
this.lastMessage = minValue2;
CircularBuffer<int> circularBuffer = new CircularBuffer(WebSocketResponse.RTTBufferCapacity);
this.rtts = circularBuffer;
this.<IsClosedManually>k__BackingField = true;
this.MaxFragmentSize = (ushort)((uint)32767);
this.closed = false;
}
// Token: 0x060098FD RID: 39165 RVA: 0x001F3E44 File Offset: 0x001F2044
[Token(Token = "0x60098FD")]
[Address(RVA = "0x638020", Offset = "0x637020", VA = "0x180638020")]
internal void StartReceive()
{
bool flag = ThreadPool.QueueUserWorkItem(new WaitCallback(this.ReceiveThreadFunc));
}
// Token: 0x060098FE RID: 39166 RVA: 0x001F3E64 File Offset: 0x001F2064
[Token(Token = "0x60098FE")]
[Address(RVA = "0x635A60", Offset = "0x634A60", VA = "0x180635A60")]
internal void CloseStream()
{
ConnectionBase connectionWith = HTTPManager.GetConnectionWith(this.baseRequest);
if (connectionWith != 0)
{
connectionWith.Abort((HTTPConnectionStates)((uint)9));
return;
}
}
// Token: 0x060098FF RID: 39167 RVA: 0x001F3E8C File Offset: 0x001F208C
[Token(Token = "0x60098FF")]
[Address(RVA = "0x637B50", Offset = "0x636B50", VA = "0x180637B50")]
public void Send(string message)
{
int num;
WebSocketFrame webSocketFrame;
do
{
num = 0;
if (message == 0)
{
goto IL_A2;
}
object obj = Encoding.UTF8.Clone();
byte[] bytes = Encoding.UTF8.GetBytes(message);
byte[] <Data>k__BackingField = webSocketFrame.<Data>k__BackingField;
if (<Data>k__BackingField == 0)
{
goto IL_99;
}
ushort num2 = this.<MaxFragmentSize>k__BackingField;
if (<Data>k__BackingField.Length <= (int)num2)
{
goto IL_99;
}
WebSocketFrame[] array = webSocketFrame.Fragment(num2);
object sendLock = this.SendLock;
this.Send(webSocketFrame);
if (array != 0 && num < array.Length)
{
WebSocketFrame webSocketFrame2 = array[num];
this.Send(webSocketFrame2);
num++;
}
Monitor.Exit(sendLock);
}
while (num != 0);
if (num != -1)
{
}
IL_99:
this.Send(webSocketFrame);
return;
IL_A2:
ArgumentNullException ex = new ArgumentNullException("message must not be null!");
throw new IndexOutOfRangeException();
}
// Token: 0x06009900 RID: 39168 RVA: 0x001F3F4C File Offset: 0x001F214C
[Token(Token = "0x6009900")]
[Address(RVA = "0x637470", Offset = "0x636470", VA = "0x180637470")]
public void Send(byte[] data)
{
int num;
WebSocketFrame webSocketFrame;
do
{
num = 0;
if (data == 0)
{
goto IL_9D;
}
int length;
ulong num2;
ulong num3;
webSocketFrame = new WebSocketFrame(this.<WebSocket>k__BackingField, (WebSocketFrameTypes)((ulong)2L), data, (ulong)num, (ulong)length, num2 != 0UL, num3 != 0UL);
length = data.Length;
byte[] <Data>k__BackingField = webSocketFrame.<Data>k__BackingField;
if (<Data>k__BackingField == 0)
{
goto IL_95;
}
ushort num4 = this.<MaxFragmentSize>k__BackingField;
if (<Data>k__BackingField.Length <= (int)num4)
{
goto IL_95;
}
WebSocketFrame[] array = webSocketFrame.Fragment(num4);
object sendLock = this.SendLock;
this.Send(webSocketFrame);
if (array != 0 && num < array.Length)
{
WebSocketFrame webSocketFrame2 = array[num];
this.Send(webSocketFrame2);
num++;
}
Monitor.Exit(sendLock);
}
while (num != 0);
if (num != -1)
{
}
IL_95:
this.Send(webSocketFrame);
return;
IL_9D:
ArgumentNullException ex = new ArgumentNullException("data must not be null!");
throw new IndexOutOfRangeException();
}
// Token: 0x06009901 RID: 39169 RVA: 0x001F4008 File Offset: 0x001F2208
[Token(Token = "0x6009901")]
[Address(RVA = "0x637690", Offset = "0x636690", VA = "0x180637690")]
public void Send(byte[] data, ulong offset, ulong count)
{
int num;
WebSocketFrame webSocketFrame;
do
{
num = 0;
if (data == 0)
{
goto IL_85;
}
int length = data.Length;
byte[] <Data>k__BackingField = webSocketFrame.<Data>k__BackingField;
if (<Data>k__BackingField == 0)
{
goto IL_7D;
}
ushort num2 = this.<MaxFragmentSize>k__BackingField;
if (<Data>k__BackingField.Length <= (int)num2)
{
goto IL_7D;
}
WebSocketFrame[] array = webSocketFrame.Fragment(num2);
object sendLock = this.SendLock;
this.Send(webSocketFrame);
if (array != 0 && num < array.Length)
{
WebSocketFrame webSocketFrame2 = array[num];
this.Send(webSocketFrame2);
num++;
}
Monitor.Exit(sendLock);
}
while (num != 0);
if (num != -1)
{
}
IL_7D:
this.Send(webSocketFrame);
return;
IL_85:
ArgumentNullException ex = new ArgumentNullException("data must not be null!");
throw new IndexOutOfRangeException();
}
// Token: 0x06009902 RID: 39170 RVA: 0x001F40AC File Offset: 0x001F22AC
[Token(Token = "0x6009902")]
[Address(RVA = "0x637900", Offset = "0x636900", VA = "0x180637900")]
public void Send(WebSocketFrame frame)
{
int num;
do
{
num = 0;
if (frame == 0)
{
goto IL_7C;
}
if (this.closed || this.closeSent)
{
return;
}
object sendLock = this.SendLock;
this.unsentFrames.Add(frame);
if (!this.sendThreadCreated)
{
ILogger logger = HTTPManager.Logger;
bool flag = ThreadPool.QueueUserWorkItem(new WaitCallback(this.SendThreadFunc));
this.sendThreadCreated = true;
}
Monitor.Exit(sendLock);
}
while (num != 0);
if (frame.<Data>k__BackingField != (ulong)0L)
{
}
bool flag2 = this.newFrameSignal.Set();
return;
IL_7C:
ArgumentNullException ex = new ArgumentNullException("frame is null!");
throw new NullReferenceException();
}
// Token: 0x06009903 RID: 39171 RVA: 0x001F414C File Offset: 0x001F234C
[Token(Token = "0x6009903")]
[Address(RVA = "0x635E70", Offset = "0x634E70", VA = "0x180635E70")]
public void Insert(WebSocketFrame frame)
{
int num;
do
{
num = 0;
if (frame == 0)
{
goto IL_83;
}
if (this.closed || this.closeSent)
{
return;
}
object sendLock = this.SendLock;
List<WebSocketFrame> list = this.unsentFrames;
int num2 = 0;
list.Insert(num2, frame);
if (!this.sendThreadCreated)
{
ILogger logger = HTTPManager.Logger;
bool flag = ThreadPool.QueueUserWorkItem(new WaitCallback(this.SendThreadFunc));
this.sendThreadCreated = true;
}
Monitor.Exit(sendLock);
}
while (num != 0);
if (frame.<Data>k__BackingField != (ulong)0L)
{
}
bool flag2 = this.newFrameSignal.Set();
return;
IL_83:
ArgumentNullException ex = new ArgumentNullException("frame is null!");
throw new NullReferenceException();
}
// Token: 0x06009904 RID: 39172 RVA: 0x001F41F4 File Offset: 0x001F23F4
[Token(Token = "0x6009904")]
[Address(RVA = "0x636B20", Offset = "0x635B20", VA = "0x180636B20")]
public void SendNow(WebSocketFrame frame)
{
/*
An exception occurred when decompiling this method (06009904)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.WebSocket.WebSocketResponse::SendNow(BestHTTP.WebSocket.Frames.WebSocketFrame)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_3C:
stloc:ArgumentNullException(var_4_46, newobj:ArgumentNullException(ArgumentNullException::.ctor, ldstr:string("frame is null!")))
}
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
--- End of inner exception stack trace ---
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
*/;
}
// Token: 0x06009905 RID: 39173 RVA: 0x001F4248 File Offset: 0x001F2448
[Token(Token = "0x6009905")]
[Address(RVA = "0x635E30", Offset = "0x634E30", VA = "0x180635E30")]
public void Close()
{
}
// Token: 0x06009906 RID: 39174 RVA: 0x001F4258 File Offset: 0x001F2458
[Token(Token = "0x6009906")]
[Address(RVA = "0x635C90", Offset = "0x634C90", VA = "0x180635C90")]
public void Close(ushort code, string msg)
{
int num;
do
{
num = 0;
if (this.closed)
{
return;
}
object sendLock = this.SendLock;
this.unsentFrames.Clear();
Monitor.Exit(sendLock);
}
while (num != 0);
WebSocket webSocket = this.<WebSocket>k__BackingField;
byte[] array = WebSocket.EncodeCloseData(code, msg);
ulong num2;
int num3;
ulong num4;
ulong num5;
WebSocketFrame webSocketFrame = new WebSocketFrame(webSocket, (WebSocketFrameTypes)((ulong)8L), array, num2, (ulong)num3, num4 != 0UL, num5 != 0UL);
if (array != 0)
{
}
num3 = 0;
this.Send(webSocketFrame);
}
// Token: 0x06009907 RID: 39175 RVA: 0x001F42D0 File Offset: 0x001F24D0
[Token(Token = "0x6009907")]
[Address(RVA = "0x637E50", Offset = "0x636E50", VA = "0x180637E50")]
public void StartPinging(int frequency)
{
Delegate @delegate;
int num;
do
{
TimeSpan timeSpan;
this.<PingFrequnecy>k__BackingField = timeSpan;
DateTime utcNow = DateTime.UtcNow;
this.lastMessage = utcNow;
this.SendPing();
HTTPManager.Heartbeats.Subscribe(this);
Action<bool> onApplicationForegroundStateChanged = HTTPUpdateDelegator.OnApplicationForegroundStateChanged;
Action<bool> action = new Action(this.OnApplicationForegroundStateChanged);
@delegate = Delegate.Combine(onApplicationForegroundStateChanged, action);
num = 0;
}
while (@delegate != 0 && @delegate == 0);
HTTPUpdateDelegator.OnApplicationForegroundStateChanged = num;
}
// Token: 0x06009908 RID: 39176 RVA: 0x001F4348 File Offset: 0x001F2548
[Token(Token = "0x6009908")]
[Address(RVA = "0x636EB0", Offset = "0x635EB0", VA = "0x180636EB0")]
private void SendThreadFunc(object param)
{
int num;
do
{
num = 0;
List<WebSocketFrame> list = new List();
if (!this.closed && !this.closeSent)
{
AutoResetEvent autoResetEvent = this.newFrameSignal;
object sendLock = this.SendLock;
int size = this.unsentFrames._size;
List<WebSocketFrame> list2 = this.unsentFrames;
list.Clear();
Monitor.Exit(sendLock);
if (num != 0)
{
goto IL_118;
}
if ((ulong)((uint)(-1)) != (ulong)(-1L))
{
}
int size2 = list._size;
list.RemoveAt(size2);
if (!this.closeSent)
{
int num2 = this.Stream.ReadByte();
if (num != 0)
{
goto IL_11E;
}
if ((ulong)((uint)(-1)) != (ulong)(-1L))
{
}
this.closeSent = true;
}
Stream stream = this.Stream;
HTTPRequest baseRequest = this.baseRequest;
baseRequest.<State>k__BackingField = (HTTPRequestStates)((ulong)5L);
this.baseRequest.<Exception>k__BackingField = baseRequest;
this.baseRequest.<State>k__BackingField = (HTTPRequestStates)((ulong)4L);
this.closed = true;
}
this.sendThreadCreated = false;
AutoResetEvent autoResetEvent2 = this.newFrameSignal;
this.newFrameSignal = (ulong)0L;
ILogger logger = HTTPManager.Logger;
}
while (num != 0);
return;
IL_118:
throw new NullReferenceException();
IL_11E:
throw new NullReferenceException();
}
// Token: 0x06009909 RID: 39177 RVA: 0x001F44A8 File Offset: 0x001F26A8
[Token(Token = "0x6009909")]
[Address(RVA = "0x636130", Offset = "0x635130", VA = "0x180636130")]
private void ReceiveThreadFunc(object param)
{
for (;;)
{
int num = 0;
ReadOnlyBufferedStream readOnlyBufferedStream = new ReadOnlyBufferedStream(this.Stream);
int num2 = 0;
uint num3;
if (!this.closed)
{
DateTime utcNow = DateTime.UtcNow;
this.lastMessage = utcNow;
if (utcNow > (ulong)10L)
{
goto IL_69;
}
if (this.OnIncompleteFrame == (ulong)0L)
{
goto IL_8C;
}
object frameLock = this.FrameLock;
List<WebSocketFrameReader> completedFrames = this.CompletedFrames;
num3 += (uint)1;
Monitor.Exit(frameLock);
if (num != 0)
{
goto IL_247;
}
if (num3 != (uint)(-1))
{
goto IL_69;
}
IL_9F:
WebSocket webSocket = this.<WebSocket>k__BackingField;
object frameLock2 = this.FrameLock;
List<WebSocketFrameReader> completedFrames2 = this.CompletedFrames;
num3 += (uint)1;
Monitor.Exit(frameLock2);
if (num != 0)
{
goto IL_253;
}
if (num3 != (uint)(-1))
{
}
if (this.closeSent || this.closed)
{
continue;
}
WebSocketFrame webSocketFrame;
if (!this.closeSent)
{
this.Send(webSocketFrame);
}
this.closed = true;
this.Send(webSocketFrame);
long num4;
num4 -= num4;
TimeSpan timeSpan = TimeSpan.FromTicks(num4);
CircularBuffer<int> circularBuffer = this.rtts;
int num5 = 0;
circularBuffer.Add(num5);
int num6 = this.CalculateLatency();
this.<Latency>k__BackingField = num6;
int num7 = 0;
Monitor.Exit(circularBuffer);
if (num != 0)
{
goto IL_26B;
}
if (num3 != (uint)(-1))
{
}
IL_154:
this.IncompleteFrames.Add(num7);
uint num8;
this.Close((ushort)num8, "Protocol Error: masked frame received from server!");
this.IncompleteFrames.Clear();
this.baseRequest.<State>k__BackingField = (HTTPRequestStates)((ulong)5L);
this.closed = true;
HTTPRequest baseRequest;
if (!this.newFrameSignal.Set())
{
baseRequest = this.baseRequest;
baseRequest.<State>k__BackingField = (HTTPRequestStates)((ulong)5L);
}
this.baseRequest.<Exception>k__BackingField = baseRequest;
this.baseRequest.<State>k__BackingField = (HTTPRequestStates)((ulong)4L);
this.closed = true;
AutoResetEvent autoResetEvent = this.newFrameSignal;
goto IL_1D8;
IL_69:
if (this.OnIncompleteFrame == (ulong)0L)
{
goto IL_154;
}
object frameLock3 = this.FrameLock;
List<WebSocketFrameReader> completedFrames3 = this.CompletedFrames;
num3 += (uint)1;
IL_8C:
List<WebSocketFrameReader> incompleteFrames = this.IncompleteFrames;
this.IncompleteFrames.Clear();
goto IL_9F;
}
IL_1D8:
num3 += (uint)1;
if (num2 != 0)
{
}
if (num == 0)
{
if (num3 != (uint)(-1))
{
}
HTTPManager.Heartbeats.Unsubscribe(this);
Action<bool> onApplicationForegroundStateChanged = HTTPUpdateDelegator.OnApplicationForegroundStateChanged;
Action<bool> action = new Action(this.OnApplicationForegroundStateChanged);
Delegate @delegate = Delegate.Remove(onApplicationForegroundStateChanged, action);
if (@delegate == 0 || @delegate != 0)
{
HTTPUpdateDelegator.OnApplicationForegroundStateChanged = @delegate;
ILogger logger = HTTPManager.Logger;
if (num == 0)
{
break;
}
}
}
}
return;
IL_247:
throw new NullReferenceException();
IL_253:
throw new NullReferenceException();
IL_26B:
throw new NullReferenceException();
}
// Token: 0x0600990A RID: 39178 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600990A")]
[Address(RVA = "0x635480", Offset = "0x634480", VA = "0x180635480", Slot = "8")]
void IProtocol.HandleEvents()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600990B RID: 39179 RVA: 0x001F4750 File Offset: 0x001F2950
[Token(Token = "0x600990B")]
[Address(RVA = "0x6350D0", Offset = "0x6340D0", VA = "0x1806350D0", Slot = "6")]
void IHeartbeat.OnHeartbeatUpdate(TimeSpan dif)
{
DateTime utcNow = DateTime.UtcNow;
DateTime dateTime = this.lastPing;
TimeSpan timeSpan = utcNow - dateTime;
TimeSpan timeSpan2 = this.<PingFrequnecy>k__BackingField;
if (timeSpan >= timeSpan2)
{
this.SendPing();
}
DateTime dateTime2 = this.lastMessage;
TimeSpan timeSpan3 = this.<PingFrequnecy>k__BackingField;
DateTime dateTime3 = dateTime2 + timeSpan3;
TimeSpan timeSpan4 = utcNow - dateTime3;
TimeSpan <CloseAfterNoMesssage>k__BackingField = this.<WebSocket>k__BackingField.<CloseAfterNoMesssage>k__BackingField;
if (timeSpan4 > <CloseAfterNoMesssage>k__BackingField)
{
ILogger logger = HTTPManager.Logger;
object[] array = new object[4];
DateTime dateTime4 = this.lastMessage;
if (array != 0)
{
}
array[0] = array;
TimeSpan timeSpan5 = this.<PingFrequnecy>k__BackingField;
if (timeSpan5 != 0)
{
}
array[1] = timeSpan5;
TimeSpan <CloseAfterNoMesssage>k__BackingField2 = this.<WebSocket>k__BackingField.<CloseAfterNoMesssage>k__BackingField;
if (<CloseAfterNoMesssage>k__BackingField2 != 0)
{
}
array[2] = <CloseAfterNoMesssage>k__BackingField2;
if (<CloseAfterNoMesssage>k__BackingField2 != 0)
{
}
array[3] = <CloseAfterNoMesssage>k__BackingField2;
string text = string.Format("No message received in the given time! Closing WebSocket. LastMessage: {0}, PingFrequency: {1}, Close After: {2}, Now: {3}", array);
this.CloseWithError("No message received in the given time!");
}
}
// Token: 0x0600990C RID: 39180 RVA: 0x001F4858 File Offset: 0x001F2A58
[Token(Token = "0x600990C")]
[Address(RVA = "0x6360C0", Offset = "0x6350C0", VA = "0x1806360C0")]
private void OnApplicationForegroundStateChanged(bool isPaused)
{
if (!isPaused)
{
DateTime utcNow = DateTime.UtcNow;
this.lastMessage = utcNow;
}
}
// Token: 0x0600990D RID: 39181 RVA: 0x001F4878 File Offset: 0x001F2A78
[Token(Token = "0x600990D")]
[Address(RVA = "0x636CD0", Offset = "0x635CD0", VA = "0x180636CD0")]
private void SendPing()
{
DateTime utcNow = DateTime.UtcNow;
this.lastPing = utcNow;
DateTime utcNow2 = DateTime.UtcNow;
byte[] array;
ulong num;
int num2;
ulong num3;
ulong num4;
WebSocketFrame webSocketFrame = new WebSocketFrame(this.<WebSocket>k__BackingField, (WebSocketFrameTypes)((ulong)9L), array, num, (ulong)num2, num3 != 0UL, num4 != 0UL);
if (array != 0)
{
}
num2 = 0;
this.Insert(webSocketFrame);
ILogger logger = HTTPManager.Logger;
}
// Token: 0x0600990E RID: 39182 RVA: 0x001F48E0 File Offset: 0x001F2AE0
[Token(Token = "0x600990E")]
[Address(RVA = "0x635AE0", Offset = "0x634AE0", VA = "0x180635AE0")]
private void CloseWithError(string message)
{
Delegate @delegate;
int num;
do
{
HTTPRequest baseRequest = this.baseRequest;
Exception ex = new Exception(message);
baseRequest.<Exception>k__BackingField = ex;
this.baseRequest.<State>k__BackingField = (HTTPRequestStates)((ulong)4L);
this.closed = true;
HTTPManager.Heartbeats.Unsubscribe(this);
Action<bool> onApplicationForegroundStateChanged = HTTPUpdateDelegator.OnApplicationForegroundStateChanged;
Action<bool> action = new Action(this.OnApplicationForegroundStateChanged);
@delegate = Delegate.Remove(onApplicationForegroundStateChanged, action);
num = 0;
}
while (@delegate != 0 && @delegate == 0);
HTTPUpdateDelegator.OnApplicationForegroundStateChanged = num;
bool flag = this.newFrameSignal.Set();
this.CloseStream();
}
// Token: 0x0600990F RID: 39183 RVA: 0x001F4970 File Offset: 0x001F2B70
[Token(Token = "0x600990F")]
[Address(RVA = "0x6359A0", Offset = "0x6349A0", VA = "0x1806359A0")]
private int CalculateLatency()
{
CircularBuffer<int> circularBuffer = this.rtts;
int num = 0;
int num2 = circularBuffer[num];
num += num2;
num++;
CircularBuffer<int> circularBuffer2 = this.rtts;
return num;
}
// Token: 0x04006769 RID: 26473
[Token(Token = "0x4006769")]
public static int RTTBufferCapacity;
// Token: 0x0400676B RID: 26475
[FieldOffset(Offset = "0xE0")]
[Token(Token = "0x400676B")]
public Action<WebSocketResponse, string> OnText;
// Token: 0x0400676C RID: 26476
[FieldOffset(Offset = "0xE8")]
[Token(Token = "0x400676C")]
public Action<WebSocketResponse, byte[]> OnBinary;
// Token: 0x0400676D RID: 26477
[FieldOffset(Offset = "0xF0")]
[Token(Token = "0x400676D")]
public Action<WebSocketResponse, WebSocketFrameReader> OnIncompleteFrame;
// Token: 0x0400676E RID: 26478
[FieldOffset(Offset = "0xF8")]
[Token(Token = "0x400676E")]
public Action<WebSocketResponse, ushort, string> OnClosed;
// Token: 0x04006771 RID: 26481
[FieldOffset(Offset = "0x10C")]
[Token(Token = "0x4006771")]
private int _bufferedAmount;
// Token: 0x04006773 RID: 26483
[FieldOffset(Offset = "0x118")]
[Token(Token = "0x4006773")]
private List<WebSocketFrameReader> IncompleteFrames;
// Token: 0x04006774 RID: 26484
[FieldOffset(Offset = "0x120")]
[Token(Token = "0x4006774")]
private List<WebSocketFrameReader> CompletedFrames;
// Token: 0x04006775 RID: 26485
[FieldOffset(Offset = "0x128")]
[Token(Token = "0x4006775")]
private List<WebSocketFrameReader> frameCache;
// Token: 0x04006776 RID: 26486
[FieldOffset(Offset = "0x130")]
[Token(Token = "0x4006776")]
private WebSocketFrameReader CloseFrame;
// Token: 0x04006777 RID: 26487
[FieldOffset(Offset = "0x150")]
[Token(Token = "0x4006777")]
private object FrameLock;
// Token: 0x04006778 RID: 26488
[FieldOffset(Offset = "0x158")]
[Token(Token = "0x4006778")]
private object SendLock;
// Token: 0x04006779 RID: 26489
[FieldOffset(Offset = "0x160")]
[Token(Token = "0x4006779")]
private List<WebSocketFrame> unsentFrames;
// Token: 0x0400677A RID: 26490
[FieldOffset(Offset = "0x168")]
[Token(Token = "0x400677A")]
private AutoResetEvent newFrameSignal;
// Token: 0x0400677B RID: 26491
[FieldOffset(Offset = "0x170")]
[Token(Token = "0x400677B")]
private bool sendThreadCreated;
// Token: 0x0400677C RID: 26492
[FieldOffset(Offset = "0x171")]
[Token(Token = "0x400677C")]
private bool closeSent;
// Token: 0x0400677D RID: 26493
[FieldOffset(Offset = "0x172")]
[Token(Token = "0x400677D")]
private bool closed;
// Token: 0x0400677E RID: 26494
[FieldOffset(Offset = "0x178")]
[Token(Token = "0x400677E")]
private DateTime lastPing;
// Token: 0x0400677F RID: 26495
[FieldOffset(Offset = "0x180")]
[Token(Token = "0x400677F")]
private DateTime lastMessage;
// Token: 0x04006780 RID: 26496
[FieldOffset(Offset = "0x188")]
[Token(Token = "0x4006780")]
private CircularBuffer<int> rtts;
}
}
@@ -0,0 +1,26 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket
{
// Token: 0x020019A1 RID: 6561
[Token(Token = "0x20019A1")]
public enum WebSocketStates : byte
{
// Token: 0x04006755 RID: 26453
[Token(Token = "0x4006755")]
Connecting,
// Token: 0x04006756 RID: 26454
[Token(Token = "0x4006756")]
Open,
// Token: 0x04006757 RID: 26455
[Token(Token = "0x4006757")]
Closing,
// Token: 0x04006758 RID: 26456
[Token(Token = "0x4006758")]
Closed,
// Token: 0x04006759 RID: 26457
[Token(Token = "0x4006759")]
Unknown
}
}
@@ -0,0 +1,50 @@
using System;
using Cpp2IlInjected;
namespace BestHTTP.WebSocket
{
// Token: 0x020019AB RID: 6571
[Token(Token = "0x20019AB")]
public enum WebSocketStausCodes : ushort
{
// Token: 0x04006782 RID: 26498
[Token(Token = "0x4006782")]
NormalClosure = 1000,
// Token: 0x04006783 RID: 26499
[Token(Token = "0x4006783")]
GoingAway,
// Token: 0x04006784 RID: 26500
[Token(Token = "0x4006784")]
ProtocolError,
// Token: 0x04006785 RID: 26501
[Token(Token = "0x4006785")]
WrongDataType,
// Token: 0x04006786 RID: 26502
[Token(Token = "0x4006786")]
Reserved,
// Token: 0x04006787 RID: 26503
[Token(Token = "0x4006787")]
NoStatusCode,
// Token: 0x04006788 RID: 26504
[Token(Token = "0x4006788")]
ClosedAbnormally,
// Token: 0x04006789 RID: 26505
[Token(Token = "0x4006789")]
DataError,
// Token: 0x0400678A RID: 26506
[Token(Token = "0x400678A")]
PolicyError,
// Token: 0x0400678B RID: 26507
[Token(Token = "0x400678B")]
TooBigMessage,
// Token: 0x0400678C RID: 26508
[Token(Token = "0x400678C")]
ExtensionExpected,
// Token: 0x0400678D RID: 26509
[Token(Token = "0x400678D")]
WrongRequest,
// Token: 0x0400678E RID: 26510
[Token(Token = "0x400678E")]
TLSHandshakeError = 1015
}
}