Fix due to the modified WsFrame.cs
This commit is contained in:
parent
672e48796a
commit
815d12f6a0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -160,15 +160,15 @@ namespace Example1
|
|||||||
int ch_num = buffer_array.GetLength(0);
|
int ch_num = buffer_array.GetLength(0);
|
||||||
int buffer_length = buffer_array.GetLength(1);
|
int buffer_length = buffer_array.GetLength(1);
|
||||||
|
|
||||||
msg.AddRange(user_id.ToBytes(ByteOrder.BIG));
|
msg.AddRange(user_id.ToByteArray(ByteOrder.BIG));
|
||||||
msg.Add((byte)ch_num);
|
msg.Add((byte)ch_num);
|
||||||
msg.AddRange(((uint)buffer_length).ToBytes(ByteOrder.BIG));
|
msg.AddRange(((uint)buffer_length).ToByteArray(ByteOrder.BIG));
|
||||||
|
|
||||||
ch_num.Times(i =>
|
ch_num.Times(i =>
|
||||||
{
|
{
|
||||||
buffer_length.Times(j =>
|
buffer_length.Times(j =>
|
||||||
{
|
{
|
||||||
msg.AddRange(buffer_array[i, j].ToBytes(ByteOrder.BIG));
|
msg.AddRange(buffer_array[i, j].ToByteArray(ByteOrder.BIG));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* Ext.cs
|
* Ext.cs
|
||||||
* IsPredefinedScheme and MaybeUri methods derived from System.Uri.cs
|
* IsPredefinedScheme and MaybeUri methods derived from System.Uri.cs
|
||||||
@ -55,7 +55,7 @@ namespace WebSocketSharp {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Ext {
|
public static class Ext {
|
||||||
|
|
||||||
#region Field
|
#region Private Const Fields
|
||||||
|
|
||||||
private const string _tspecials = "()<>@,;:\\\"/[]?={} \t";
|
private const string _tspecials = "()<>@,;:\\\"/[]?={} \t";
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Internal Method
|
#region Internal Methods
|
||||||
|
|
||||||
internal static string GetNameInternal(this string nameAndValue, string separator)
|
internal static string GetNameInternal(this string nameAndValue, string separator)
|
||||||
{
|
{
|
||||||
@ -1202,7 +1202,7 @@ namespace WebSocketSharp {
|
|||||||
/// <typeparam name="T">
|
/// <typeparam name="T">
|
||||||
/// The type of the <paramref name="value"/>. The T must be a value type.
|
/// The type of the <paramref name="value"/>. The T must be a value type.
|
||||||
/// </typeparam>
|
/// </typeparam>
|
||||||
public static byte[] ToBytes<T>(this T value, ByteOrder order)
|
public static byte[] ToByteArray<T>(this T value, ByteOrder order)
|
||||||
where T : struct
|
where T : struct
|
||||||
{
|
{
|
||||||
var type = typeof(T);
|
var type = typeof(T);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* Opcode.cs
|
* Opcode.cs
|
||||||
*
|
*
|
||||||
|
@ -106,17 +106,9 @@ namespace WebSocketSharp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
internal bool IsMasked { get; private set; }
|
||||||
|
|
||||||
#region Public Properties
|
internal ulong Length {
|
||||||
|
|
||||||
public byte[] ApplicationData { get; private set; }
|
|
||||||
|
|
||||||
public byte[] ExtensionData { get; private set; }
|
|
||||||
|
|
||||||
public bool IsMasked { get; private set; }
|
|
||||||
|
|
||||||
public ulong Length {
|
|
||||||
get {
|
get {
|
||||||
return (ulong)(ExtensionData.LongLength + ApplicationData.LongLength);
|
return (ulong)(ExtensionData.LongLength + ApplicationData.LongLength);
|
||||||
}
|
}
|
||||||
@ -124,6 +116,14 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public byte[] ExtensionData { get; private set; }
|
||||||
|
|
||||||
|
public byte[] ApplicationData { get; private set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
private static void mask(byte[] src, byte[] key)
|
private static void mask(byte[] src, byte[] key)
|
||||||
@ -164,7 +164,9 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
public byte[] ToByteArray()
|
public byte[] ToByteArray()
|
||||||
{
|
{
|
||||||
return this.ToArray();
|
return ExtensionData.LongLength > 0
|
||||||
|
? this.ToArray()
|
||||||
|
: ApplicationData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
|
@ -408,7 +408,7 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
private void close(ushort code, string reason)
|
private void close(ushort code, string reason)
|
||||||
{
|
{
|
||||||
var data = new List<byte>(code.ToBytes(ByteOrder.BIG));
|
var data = new List<byte>(code.ToByteArray(ByteOrder.BIG));
|
||||||
if (!reason.IsNullOrEmpty())
|
if (!reason.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
var buffer = Encoding.UTF8.GetBytes(reason);
|
var buffer = Encoding.UTF8.GetBytes(reason);
|
||||||
|
@ -36,7 +36,7 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
internal class WsFrame : IEnumerable<byte>
|
internal class WsFrame : IEnumerable<byte>
|
||||||
{
|
{
|
||||||
#region Fields
|
#region Private Const Fields
|
||||||
|
|
||||||
private const int _readBufferLen = 1024;
|
private const int _readBufferLen = 1024;
|
||||||
|
|
||||||
@ -46,11 +46,6 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
private WsFrame()
|
private WsFrame()
|
||||||
{
|
{
|
||||||
Rsv1 = Rsv.OFF;
|
|
||||||
Rsv2 = Rsv.OFF;
|
|
||||||
Rsv3 = Rsv.OFF;
|
|
||||||
ExtPayloadLen = new byte[]{};
|
|
||||||
MaskingKey = new byte[]{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -68,11 +63,20 @@ namespace WebSocketSharp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public WsFrame(Fin fin, Opcode opcode, Mask mask, PayloadData payloadData)
|
public WsFrame(Fin fin, Opcode opcode, Mask mask, PayloadData payloadData)
|
||||||
: this()
|
|
||||||
{
|
{
|
||||||
|
if (payloadData.IsNull())
|
||||||
|
throw new ArgumentNullException("payloadData");
|
||||||
|
|
||||||
|
if (isControl(opcode) && payloadData.Length > 125)
|
||||||
|
throw new ArgumentOutOfRangeException("payloadData",
|
||||||
|
"The control frame must have a payload length of 125 bytes or less.");
|
||||||
|
|
||||||
|
if (!isFinal(fin) && isControl(opcode))
|
||||||
|
throw new ArgumentException("The control frame must not be fragmented.");
|
||||||
|
|
||||||
Fin = fin;
|
Fin = fin;
|
||||||
Opcode = opcode;
|
Opcode = opcode;
|
||||||
Masked = mask;
|
Mask = mask;
|
||||||
PayloadData = payloadData;
|
PayloadData = payloadData;
|
||||||
|
|
||||||
init();
|
init();
|
||||||
@ -80,52 +84,169 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Internal Properties
|
||||||
|
|
||||||
public Fin Fin { get; private set; }
|
internal bool IsControl {
|
||||||
public Rsv Rsv1 { get; private set; }
|
|
||||||
public Rsv Rsv2 { get; private set; }
|
|
||||||
public Rsv Rsv3 { get; private set; }
|
|
||||||
public Opcode Opcode { get; private set; }
|
|
||||||
public Mask Masked { get; private set; }
|
|
||||||
public byte PayloadLen { get; private set; }
|
|
||||||
public byte[] ExtPayloadLen { get; private set; }
|
|
||||||
public byte[] MaskingKey { get; private set; }
|
|
||||||
public PayloadData PayloadData { get; private set; }
|
|
||||||
|
|
||||||
public bool IsData {
|
|
||||||
get {
|
get {
|
||||||
Opcode data = Opcode.TEXT | Opcode.BINARY;
|
return isControl(Opcode);
|
||||||
return (data & Opcode) == Opcode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ulong Length {
|
internal bool IsData {
|
||||||
get {
|
get {
|
||||||
return 2 + (ulong)(ExtPayloadLen.Length + MaskingKey.Length) + PayloadLength;
|
return isData(Opcode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ulong PayloadLength {
|
internal bool IsFinal {
|
||||||
get {
|
get {
|
||||||
return PayloadData.Length;
|
return isFinal(Fin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal bool IsMasked {
|
||||||
|
get {
|
||||||
|
return isMasked(Mask);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal ulong Length {
|
||||||
|
get {
|
||||||
|
return 2 + (ulong)(ExtPayloadLen.Length + MaskingKey.Length) + PayloadData.Length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
public Fin Fin { get; private set; }
|
||||||
|
|
||||||
|
public Rsv Rsv1 { get; private set; }
|
||||||
|
|
||||||
|
public Rsv Rsv2 { get; private set; }
|
||||||
|
|
||||||
|
public Rsv Rsv3 { get; private set; }
|
||||||
|
|
||||||
|
public Opcode Opcode { get; private set; }
|
||||||
|
|
||||||
|
public Mask Mask { get; private set; }
|
||||||
|
|
||||||
|
public byte PayloadLen { get; private set; }
|
||||||
|
|
||||||
|
public byte[] ExtPayloadLen { get; private set; }
|
||||||
|
|
||||||
|
public byte[] MaskingKey { get; private set; }
|
||||||
|
|
||||||
|
public PayloadData PayloadData { get; private set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
IEnumerator IEnumerable.GetEnumerator()
|
private static void dump(WsFrame frame)
|
||||||
{
|
{
|
||||||
return GetEnumerator();
|
var len = frame.Length;
|
||||||
|
var count = (long)(len / 4);
|
||||||
|
var remainder = (int)(len % 4);
|
||||||
|
|
||||||
|
int countDigit;
|
||||||
|
string countFmt;
|
||||||
|
if (count < 10000)
|
||||||
|
{
|
||||||
|
countDigit = 4;
|
||||||
|
countFmt = "{0,4}";
|
||||||
|
}
|
||||||
|
else if (count < 0x010000)
|
||||||
|
{
|
||||||
|
countDigit = 4;
|
||||||
|
countFmt = "{0,4:X}";
|
||||||
|
}
|
||||||
|
else if (count < 0x0100000000)
|
||||||
|
{
|
||||||
|
countDigit = 8;
|
||||||
|
countFmt = "{0,8:X}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
countDigit = 16;
|
||||||
|
countFmt = "{0,16:X}";
|
||||||
|
}
|
||||||
|
|
||||||
|
var spFmt = String.Format("{{0,{0}}}", countDigit);
|
||||||
|
var headerFmt = String.Format(@"
|
||||||
|
{0} 01234567 89ABCDEF 01234567 89ABCDEF
|
||||||
|
{0}+--------+--------+--------+--------+", spFmt);
|
||||||
|
var footerFmt = String.Format(" {0}+--------+--------+--------+--------+", spFmt);
|
||||||
|
|
||||||
|
Func<string, Action<string, string, string, string>> linePrinter = lineNumberFmt =>
|
||||||
|
{
|
||||||
|
long lineCount = 0;
|
||||||
|
string lineFmt = String.Format(" {0}|{{1,8}} {{2,8}} {{3,8}} {{4,8}}|", lineNumberFmt);
|
||||||
|
return (arg1, arg2, arg3, arg4) =>
|
||||||
|
{
|
||||||
|
Console.WriteLine(lineFmt, ++lineCount, arg1, arg2, arg3, arg4);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
var printLine = linePrinter(countFmt);
|
||||||
|
|
||||||
|
Console.WriteLine(headerFmt, String.Empty);
|
||||||
|
|
||||||
|
var buffer = frame.ToByteArray();
|
||||||
|
int i, j;
|
||||||
|
for (i = 0; i <= count; i++)
|
||||||
|
{
|
||||||
|
j = i * 4;
|
||||||
|
if (i < count)
|
||||||
|
printLine(
|
||||||
|
Convert.ToString(buffer[j], 2).PadLeft(8, '0'),
|
||||||
|
Convert.ToString(buffer[j + 1], 2).PadLeft(8, '0'),
|
||||||
|
Convert.ToString(buffer[j + 2], 2).PadLeft(8, '0'),
|
||||||
|
Convert.ToString(buffer[j + 3], 2).PadLeft(8, '0'));
|
||||||
|
else if (remainder > 0)
|
||||||
|
printLine(
|
||||||
|
Convert.ToString(buffer[j], 2).PadLeft(8, '0'),
|
||||||
|
remainder >= 2 ? Convert.ToString(buffer[j + 1], 2).PadLeft(8, '0') : String.Empty,
|
||||||
|
remainder == 3 ? Convert.ToString(buffer[j + 2], 2).PadLeft(8, '0') : String.Empty,
|
||||||
|
String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine(footerFmt, String.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
setPayloadLen(PayloadLength);
|
Rsv1 = Rsv.OFF;
|
||||||
if (Masked == Mask.MASK)
|
Rsv2 = Rsv.OFF;
|
||||||
|
Rsv3 = Rsv.OFF;
|
||||||
|
|
||||||
|
setPayloadLen(PayloadData.Length);
|
||||||
|
if (IsMasked)
|
||||||
maskPayloadData();
|
maskPayloadData();
|
||||||
|
else
|
||||||
|
MaskingKey = new byte[]{};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool isControl(Opcode opcode)
|
||||||
|
{
|
||||||
|
Opcode control = Opcode.CLOSE | Opcode.PING | Opcode.PONG;
|
||||||
|
return (control & opcode) == opcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool isData(Opcode opcode)
|
||||||
|
{
|
||||||
|
Opcode data = Opcode.TEXT | Opcode.BINARY;
|
||||||
|
return (data & opcode) == opcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool isFinal(Fin fin)
|
||||||
|
{
|
||||||
|
return fin == Fin.FINAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool isMasked(Mask mask)
|
||||||
|
{
|
||||||
|
return mask == Mask.MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void maskPayloadData()
|
private void maskPayloadData()
|
||||||
@ -138,18 +259,11 @@ namespace WebSocketSharp {
|
|||||||
PayloadData.Mask(key);
|
PayloadData.Mask(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static WsFrame parse(Stream stream, bool unmask)
|
|
||||||
{
|
|
||||||
return parse(stream.ReadBytes(2), stream, unmask);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static WsFrame parse(byte[] header, Stream stream, bool unmask)
|
private static WsFrame parse(byte[] header, Stream stream, bool unmask)
|
||||||
{
|
{
|
||||||
if (header.IsNull() || header.Length != 2)
|
if (header.IsNull() || header.Length != 2)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var frame = readHeader(header);
|
var frame = readHeader(header);
|
||||||
readExtPayloadLen(stream, frame);
|
readExtPayloadLen(stream, frame);
|
||||||
readMaskingKey(stream, frame);
|
readMaskingKey(stream, frame);
|
||||||
@ -157,28 +271,63 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
catch
|
|
||||||
|
private static void print(WsFrame frame)
|
||||||
{
|
{
|
||||||
return null;
|
var len = frame.ExtPayloadLen.Length;
|
||||||
}
|
var extPayloadLen = len == 2
|
||||||
|
? frame.ExtPayloadLen.To<ushort>(ByteOrder.BIG).ToString()
|
||||||
|
: len == 8
|
||||||
|
? frame.ExtPayloadLen.To<ulong>(ByteOrder.BIG).ToString()
|
||||||
|
: String.Empty;
|
||||||
|
|
||||||
|
var masked = frame.IsMasked;
|
||||||
|
var maskingKey = masked
|
||||||
|
? BitConverter.ToString(frame.MaskingKey)
|
||||||
|
: String.Empty;
|
||||||
|
|
||||||
|
var opcode = frame.Opcode;
|
||||||
|
var payloadData = frame.PayloadData.Length == 0
|
||||||
|
? String.Empty
|
||||||
|
: masked || ((Opcode.CONT | Opcode.BINARY | Opcode.CLOSE) & opcode) == opcode
|
||||||
|
? BitConverter.ToString(frame.PayloadData.ToByteArray())
|
||||||
|
: Encoding.UTF8.GetString(frame.PayloadData.ToByteArray());
|
||||||
|
|
||||||
|
var format = @"
|
||||||
|
FIN: {0}
|
||||||
|
RSV1: {1}
|
||||||
|
RSV2: {2}
|
||||||
|
RSV3: {3}
|
||||||
|
Opcode: {4}
|
||||||
|
MASK: {5}
|
||||||
|
Payload Len: {6}
|
||||||
|
Extended Payload Len: {7}
|
||||||
|
Masking Key: {8}
|
||||||
|
Payload Data: {9}";
|
||||||
|
|
||||||
|
Console.WriteLine(
|
||||||
|
format, frame.Fin, frame.Rsv1, frame.Rsv2, frame.Rsv3, opcode, frame.Mask, frame.PayloadLen, extPayloadLen, maskingKey, payloadData);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void readExtPayloadLen(Stream stream, WsFrame frame)
|
private static void readExtPayloadLen(Stream stream, WsFrame frame)
|
||||||
{
|
{
|
||||||
var length = frame.PayloadLen <= 125
|
int length = frame.PayloadLen <= 125
|
||||||
? 0
|
? 0
|
||||||
: frame.PayloadLen == 126
|
: frame.PayloadLen == 126
|
||||||
? 2
|
? 2
|
||||||
: 8;
|
: 8;
|
||||||
|
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
|
{
|
||||||
|
frame.ExtPayloadLen = new byte[]{};
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var extLen = stream.ReadBytes(length);
|
var extPayloadLen = stream.ReadBytes(length);
|
||||||
if (extLen.Length != length)
|
if (extPayloadLen.Length != length)
|
||||||
throw new IOException();
|
throw new IOException();
|
||||||
|
|
||||||
frame.ExtPayloadLen = extLen;
|
frame.ExtPayloadLen = extPayloadLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static WsFrame readHeader(byte[] header)
|
private static WsFrame readHeader(byte[] header)
|
||||||
@ -194,7 +343,7 @@ namespace WebSocketSharp {
|
|||||||
// Opcode
|
// Opcode
|
||||||
Opcode opcode = (Opcode)(header[0] & 0x0f);
|
Opcode opcode = (Opcode)(header[0] & 0x0f);
|
||||||
// MASK
|
// MASK
|
||||||
Mask masked = (header[1] & 0x80) == 0x80 ? Mask.MASK : Mask.UNMASK;
|
Mask mask = (header[1] & 0x80) == 0x80 ? Mask.MASK : Mask.UNMASK;
|
||||||
// Payload len
|
// Payload len
|
||||||
byte payloadLen = (byte)(header[1] & 0x7f);
|
byte payloadLen = (byte)(header[1] & 0x7f);
|
||||||
|
|
||||||
@ -204,15 +353,18 @@ namespace WebSocketSharp {
|
|||||||
Rsv2 = rsv2,
|
Rsv2 = rsv2,
|
||||||
Rsv3 = rsv3,
|
Rsv3 = rsv3,
|
||||||
Opcode = opcode,
|
Opcode = opcode,
|
||||||
Masked = masked,
|
Mask = mask,
|
||||||
PayloadLen = payloadLen
|
PayloadLen = payloadLen
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void readMaskingKey(Stream stream, WsFrame frame)
|
private static void readMaskingKey(Stream stream, WsFrame frame)
|
||||||
{
|
{
|
||||||
if (frame.Masked == Mask.UNMASK)
|
if (!isMasked(frame.Mask))
|
||||||
|
{
|
||||||
|
frame.MaskingKey = new byte[]{};
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var maskingKey = stream.ReadBytes(4);
|
var maskingKey = stream.ReadBytes(4);
|
||||||
if (maskingKey.Length != 4)
|
if (maskingKey.Length != 4)
|
||||||
@ -231,7 +383,7 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
{
|
{
|
||||||
frame.PayloadData = new PayloadData(new byte[]{});
|
frame.PayloadData = new PayloadData();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,14 +397,15 @@ namespace WebSocketSharp {
|
|||||||
if (buffer.LongLength != (long)length)
|
if (buffer.LongLength != (long)length)
|
||||||
throw new IOException();
|
throw new IOException();
|
||||||
|
|
||||||
var payloadData = frame.Masked == Mask.MASK
|
var masked = isMasked(frame.Mask);
|
||||||
|
var payloadData = masked
|
||||||
? new PayloadData(buffer, true)
|
? new PayloadData(buffer, true)
|
||||||
: new PayloadData(buffer);
|
: new PayloadData(buffer);
|
||||||
|
|
||||||
if (frame.Masked == Mask.MASK && unmask)
|
if (masked && unmask)
|
||||||
{
|
{
|
||||||
payloadData.Mask(frame.MaskingKey);
|
payloadData.Mask(frame.MaskingKey);
|
||||||
frame.Masked = Mask.UNMASK;
|
frame.Mask = Mask.UNMASK;
|
||||||
frame.MaskingKey = new byte[]{};
|
frame.MaskingKey = new byte[]{};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,18 +417,19 @@ namespace WebSocketSharp {
|
|||||||
if (length < 126)
|
if (length < 126)
|
||||||
{
|
{
|
||||||
PayloadLen = (byte)length;
|
PayloadLen = (byte)length;
|
||||||
|
ExtPayloadLen = new byte[]{};
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length < 0x010000)
|
if (length < 0x010000)
|
||||||
{
|
{
|
||||||
PayloadLen = (byte)126;
|
PayloadLen = (byte)126;
|
||||||
ExtPayloadLen = ((ushort)length).ToBytes(ByteOrder.BIG);
|
ExtPayloadLen = ((ushort)length).ToByteArray(ByteOrder.BIG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PayloadLen = (byte)127;
|
PayloadLen = (byte)127;
|
||||||
ExtPayloadLen = length.ToBytes(ByteOrder.BIG);
|
ExtPayloadLen = length.ToByteArray(ByteOrder.BIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -284,7 +438,7 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
public IEnumerator<byte> GetEnumerator()
|
public IEnumerator<byte> GetEnumerator()
|
||||||
{
|
{
|
||||||
foreach (byte b in ToBytes())
|
foreach (byte b in ToByteArray())
|
||||||
yield return b;
|
yield return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,6 +447,11 @@ namespace WebSocketSharp {
|
|||||||
return Parse(src, true);
|
return Parse(src, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static WsFrame Parse(Stream stream)
|
||||||
|
{
|
||||||
|
return Parse(stream, true);
|
||||||
|
}
|
||||||
|
|
||||||
public static WsFrame Parse(byte[] src, bool unmask)
|
public static WsFrame Parse(byte[] src, bool unmask)
|
||||||
{
|
{
|
||||||
using (MemoryStream ms = new MemoryStream(src))
|
using (MemoryStream ms = new MemoryStream(src))
|
||||||
@ -301,14 +460,26 @@ namespace WebSocketSharp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static WsFrame Parse(Stream stream)
|
|
||||||
{
|
|
||||||
return Parse(stream, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static WsFrame Parse(Stream stream, bool unmask)
|
public static WsFrame Parse(Stream stream, bool unmask)
|
||||||
{
|
{
|
||||||
return parse(stream, unmask);
|
return Parse(stream, unmask, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WsFrame Parse(Stream stream, bool unmask, Action<Exception> error)
|
||||||
|
{
|
||||||
|
WsFrame frame = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var header = stream.ReadBytes(2);
|
||||||
|
frame = parse(header, stream, unmask);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (!error.IsNull())
|
||||||
|
error(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ParseAsync(Stream stream, Action<WsFrame> completed)
|
public static void ParseAsync(Stream stream, Action<WsFrame> completed)
|
||||||
@ -356,138 +527,31 @@ namespace WebSocketSharp {
|
|||||||
stream.BeginRead(header, 0, 2, callback, null);
|
stream.BeginRead(header, 0, 2, callback, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Print()
|
public void Print(bool dumped)
|
||||||
{
|
{
|
||||||
byte[] buffer;
|
if (dumped)
|
||||||
long count, i, j;
|
dump(this);
|
||||||
int countDigit, remainder;
|
|
||||||
string countFmt, extPayloadLen, headerFmt, topLineFmt, bottomLineFmt, payloadData, spFmt;
|
|
||||||
|
|
||||||
switch (ExtPayloadLen.Length)
|
|
||||||
{
|
|
||||||
case 2:
|
|
||||||
extPayloadLen = ExtPayloadLen.To<ushort>(ByteOrder.BIG).ToString();
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
extPayloadLen = ExtPayloadLen.To<ulong>(ByteOrder.BIG).ToString();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
extPayloadLen = String.Empty;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (((Opcode.TEXT | Opcode.PING | Opcode.PONG) & Opcode) == Opcode &&
|
|
||||||
Masked == Mask.UNMASK &&
|
|
||||||
PayloadLength > 0)
|
|
||||||
{
|
|
||||||
payloadData = Encoding.UTF8.GetString(PayloadData.ToByteArray());
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
print(this);
|
||||||
payloadData = BitConverter.ToString(PayloadData.ToByteArray());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
headerFmt = @"
|
public byte[] ToByteArray()
|
||||||
WsFrame:
|
|
||||||
|
|
||||||
FIN={0}, RSV1={1}, RSV2={2}, RSV3={3}, Opcode={4},
|
|
||||||
MASK={5}, Payload Len={6}, Extended Payload Len={7},
|
|
||||||
Masking Key ={8},
|
|
||||||
Payload Data={9}";
|
|
||||||
|
|
||||||
buffer = ToBytes();
|
|
||||||
count = (long)(Length / 4);
|
|
||||||
remainder = (int)(Length % 4);
|
|
||||||
|
|
||||||
if (count < 10000)
|
|
||||||
{
|
|
||||||
countDigit = 4;
|
|
||||||
countFmt = "{0,4}";
|
|
||||||
}
|
|
||||||
else if (count < 0x010000)
|
|
||||||
{
|
|
||||||
countDigit = 4;
|
|
||||||
countFmt = "{0,4:X}";
|
|
||||||
}
|
|
||||||
else if (count < 0x0100000000)
|
|
||||||
{
|
|
||||||
countDigit = 8;
|
|
||||||
countFmt = "{0,8:X}";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
countDigit = 16;
|
|
||||||
countFmt = "{0,16:X}";
|
|
||||||
}
|
|
||||||
|
|
||||||
spFmt = String.Format("{{0,{0}}}", countDigit);
|
|
||||||
|
|
||||||
topLineFmt = String.Format(@"
|
|
||||||
{0} 01234567 89ABCDEF 01234567 89ABCDEF
|
|
||||||
{0}+--------+--------+--------+--------+", spFmt);
|
|
||||||
|
|
||||||
Func<string, Action<string, string, string, string>> func = s =>
|
|
||||||
{
|
|
||||||
long lineCount = 0;
|
|
||||||
string lineFmt = String.Format(" {0}|{{1,8}} {{2,8}} {{3,8}} {{4,8}}|", s);
|
|
||||||
return (arg1, arg2, arg3, arg4) =>
|
|
||||||
{
|
|
||||||
Console.WriteLine(lineFmt, ++lineCount, arg1, arg2, arg3, arg4);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
var printLine = func(countFmt);
|
|
||||||
|
|
||||||
bottomLineFmt = String.Format(" {0}+--------+--------+--------+--------+", spFmt);
|
|
||||||
|
|
||||||
Console.WriteLine(headerFmt,
|
|
||||||
Fin, Rsv1, Rsv2, Rsv3, Opcode,
|
|
||||||
Masked, PayloadLen, extPayloadLen,
|
|
||||||
BitConverter.ToString(MaskingKey),
|
|
||||||
payloadData);
|
|
||||||
|
|
||||||
Console.WriteLine(topLineFmt, String.Empty);
|
|
||||||
|
|
||||||
for (i = 0; i <= count; i++)
|
|
||||||
{
|
|
||||||
j = i * 4;
|
|
||||||
if (i < count)
|
|
||||||
{
|
|
||||||
printLine(
|
|
||||||
Convert.ToString(buffer[j], 2).PadLeft(8, '0'),
|
|
||||||
Convert.ToString(buffer[j + 1], 2).PadLeft(8, '0'),
|
|
||||||
Convert.ToString(buffer[j + 2], 2).PadLeft(8, '0'),
|
|
||||||
Convert.ToString(buffer[j + 3], 2).PadLeft(8, '0'));
|
|
||||||
}
|
|
||||||
else if (i == count && remainder > 0)
|
|
||||||
{
|
|
||||||
printLine(
|
|
||||||
Convert.ToString(buffer[j], 2).PadLeft(8, '0'),
|
|
||||||
remainder >= 2 ? Convert.ToString(buffer[j + 1], 2).PadLeft(8, '0') : String.Empty,
|
|
||||||
remainder == 3 ? Convert.ToString(buffer[j + 2], 2).PadLeft(8, '0') : String.Empty,
|
|
||||||
String.Empty);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Console.WriteLine(bottomLineFmt, String.Empty);
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte[] ToBytes()
|
|
||||||
{
|
{
|
||||||
var buffer = new List<byte>();
|
var buffer = new List<byte>();
|
||||||
|
|
||||||
var header = (int)Fin;
|
int header = (int)Fin;
|
||||||
header = (header << 1) + (int)Rsv1;
|
header = (header << 1) + (int)Rsv1;
|
||||||
header = (header << 1) + (int)Rsv2;
|
header = (header << 1) + (int)Rsv2;
|
||||||
header = (header << 1) + (int)Rsv3;
|
header = (header << 1) + (int)Rsv3;
|
||||||
header = (header << 4) + (int)Opcode;
|
header = (header << 4) + (int)Opcode;
|
||||||
header = (header << 1) + (int)Masked;
|
header = (header << 1) + (int)Mask;
|
||||||
header = (header << 7) + (int)PayloadLen;
|
header = (header << 7) + (int)PayloadLen;
|
||||||
buffer.AddRange(((ushort)header).ToBytes(ByteOrder.BIG));
|
buffer.AddRange(((ushort)header).ToByteArray(ByteOrder.BIG));
|
||||||
|
|
||||||
if (PayloadLen >= 126)
|
if (PayloadLen >= 126)
|
||||||
buffer.AddRange(ExtPayloadLen);
|
buffer.AddRange(ExtPayloadLen);
|
||||||
|
|
||||||
if (Masked == Mask.MASK)
|
if (IsMasked)
|
||||||
buffer.AddRange(MaskingKey);
|
buffer.AddRange(MaskingKey);
|
||||||
|
|
||||||
if (PayloadLen > 0)
|
if (PayloadLen > 0)
|
||||||
@ -498,7 +562,16 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return BitConverter.ToString(ToBytes());
|
return BitConverter.ToString(ToByteArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Explicitly Implemented Interface Members
|
||||||
|
|
||||||
|
IEnumerator IEnumerable.GetEnumerator()
|
||||||
|
{
|
||||||
|
return GetEnumerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#region MIT License
|
#region License
|
||||||
/*
|
/*
|
||||||
* WsStream.cs
|
* WsStream.cs
|
||||||
*
|
*
|
||||||
@ -40,7 +40,7 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
internal class WsStream : IDisposable
|
internal class WsStream : IDisposable
|
||||||
{
|
{
|
||||||
#region Fields
|
#region Private Fields
|
||||||
|
|
||||||
private Stream _innerStream;
|
private Stream _innerStream;
|
||||||
private bool _isSecure;
|
private bool _isSecure;
|
||||||
@ -49,7 +49,7 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Private Constructor
|
#region Private Constructors
|
||||||
|
|
||||||
private WsStream()
|
private WsStream()
|
||||||
{
|
{
|
||||||
@ -83,7 +83,7 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Public Properties
|
||||||
|
|
||||||
public bool DataAvailable {
|
public bool DataAvailable {
|
||||||
get {
|
get {
|
||||||
@ -251,7 +251,7 @@ namespace WebSocketSharp {
|
|||||||
|
|
||||||
public bool Write(WsFrame frame)
|
public bool Write(WsFrame frame)
|
||||||
{
|
{
|
||||||
return write(frame.ToBytes());
|
return write(frame.ToByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Write(Handshake handshake)
|
public bool Write(Handshake handshake)
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -607,7 +607,7 @@
|
|||||||
Is thrown when the <paramref name="src" /> parameter passed to a method is invalid because it is <see langword="null" />.
|
Is thrown when the <paramref name="src" /> parameter passed to a method is invalid because it is <see langword="null" />.
|
||||||
</exception>
|
</exception>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:WebSocketSharp.Ext.ToBytes``1(``0,WebSocketSharp.ByteOrder)">
|
<member name="M:WebSocketSharp.Ext.ToByteArray``1(``0,WebSocketSharp.ByteOrder)">
|
||||||
<summary>
|
<summary>
|
||||||
Converts the specified data to an array of <see cref="T:System.Byte" />.
|
Converts the specified data to an array of <see cref="T:System.Byte" />.
|
||||||
</summary>
|
</summary>
|
||||||
|
@ -693,7 +693,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<b>
|
<b>
|
||||||
<a href="#M:WebSocketSharp.Ext.ToBytes``1(``0,WebSocketSharp.ByteOrder)">ToBytes<T></a>
|
<a href="#M:WebSocketSharp.Ext.ToByteArray``1(``0,WebSocketSharp.ByteOrder)">ToByteArray<T></a>
|
||||||
</b>(<i>this</i> <i title="
 The type of the . The T must be a value type.
 ">T</i>, <a href="../WebSocketSharp/ByteOrder.html">ByteOrder</a>)<nobr> : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Byte">byte</a>[]</nobr><blockquote>
|
</b>(<i>this</i> <i title="
 The type of the . The T must be a value type.
 ">T</i>, <a href="../WebSocketSharp/ByteOrder.html">ByteOrder</a>)<nobr> : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Byte">byte</a>[]</nobr><blockquote>
|
||||||
Converts the specified data to an array of <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Byte">byte</a>.
|
Converts the specified data to an array of <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Byte">byte</a>.
|
||||||
</blockquote></td>
|
</blockquote></td>
|
||||||
@ -2431,15 +2431,15 @@
|
|||||||
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
|
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
|
||||||
<hr size="1" />
|
<hr size="1" />
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<h3 id="M:WebSocketSharp.Ext.ToBytes``1(``0,WebSocketSharp.ByteOrder)">ToBytes<T> Generic Method</h3>
|
<h3 id="M:WebSocketSharp.Ext.ToByteArray``1(``0,WebSocketSharp.ByteOrder)">ToByteArray<T> Generic Method</h3>
|
||||||
<blockquote id="M:WebSocketSharp.Ext.ToBytes``1(``0,WebSocketSharp.ByteOrder):member">
|
<blockquote id="M:WebSocketSharp.Ext.ToByteArray``1(``0,WebSocketSharp.ByteOrder):member">
|
||||||
<p class="Summary">
|
<p class="Summary">
|
||||||
Converts the specified data to an array of <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Byte">byte</a>.
|
Converts the specified data to an array of <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Byte">byte</a>.
|
||||||
</p>
|
</p>
|
||||||
<h2>Syntax</h2>
|
<h2>Syntax</h2>
|
||||||
<div class="Signature">public static <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Byte">byte</a>[] <b>ToBytes<T></b> (<i>this</i> <i title="
 The type of the . The T must be a value type.
 ">T</i> value, <a href="../WebSocketSharp/ByteOrder.html">ByteOrder</a> order)<br /> where T : struct</div>
|
<div class="Signature">public static <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Byte">byte</a>[] <b>ToByteArray<T></b> (<i>this</i> <i title="
 The type of the . The T must be a value type.
 ">T</i> value, <a href="../WebSocketSharp/ByteOrder.html">ByteOrder</a> order)<br /> where T : struct</div>
|
||||||
<h4 class="Subsection">Type Parameters</h4>
|
<h4 class="Subsection">Type Parameters</h4>
|
||||||
<blockquote class="SubsectionBox" id="M:WebSocketSharp.Ext.ToBytes``1(``0,WebSocketSharp.ByteOrder):Type Parameters">
|
<blockquote class="SubsectionBox" id="M:WebSocketSharp.Ext.ToByteArray``1(``0,WebSocketSharp.ByteOrder):Type Parameters">
|
||||||
<dl>
|
<dl>
|
||||||
<dt>
|
<dt>
|
||||||
<i>T</i>
|
<i>T</i>
|
||||||
@ -2450,7 +2450,7 @@
|
|||||||
</dl>
|
</dl>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<h4 class="Subsection">Parameters</h4>
|
<h4 class="Subsection">Parameters</h4>
|
||||||
<blockquote class="SubsectionBox" id="M:WebSocketSharp.Ext.ToBytes``1(``0,WebSocketSharp.ByteOrder):Parameters">
|
<blockquote class="SubsectionBox" id="M:WebSocketSharp.Ext.ToByteArray``1(``0,WebSocketSharp.ByteOrder):Parameters">
|
||||||
<dl>
|
<dl>
|
||||||
<dt>
|
<dt>
|
||||||
<i>value</i>
|
<i>value</i>
|
||||||
@ -2467,15 +2467,15 @@
|
|||||||
</dl>
|
</dl>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<h4 class="Subsection">Returns</h4>
|
<h4 class="Subsection">Returns</h4>
|
||||||
<blockquote class="SubsectionBox" id="M:WebSocketSharp.Ext.ToBytes``1(``0,WebSocketSharp.ByteOrder):Returns">
|
<blockquote class="SubsectionBox" id="M:WebSocketSharp.Ext.ToByteArray``1(``0,WebSocketSharp.ByteOrder):Returns">
|
||||||
An array of <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Byte">byte</a> converted from the <i>value</i>.
|
An array of <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Byte">byte</a> converted from the <i>value</i>.
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<h2 class="Section">Remarks</h2>
|
<h2 class="Section">Remarks</h2>
|
||||||
<div class="SectionBox" id="M:WebSocketSharp.Ext.ToBytes``1(``0,WebSocketSharp.ByteOrder):Remarks">
|
<div class="SectionBox" id="M:WebSocketSharp.Ext.ToByteArray``1(``0,WebSocketSharp.ByteOrder):Remarks">
|
||||||
<span class="NotEntered">Documentation for this section has not yet been entered.</span>
|
<span class="NotEntered">Documentation for this section has not yet been entered.</span>
|
||||||
</div>
|
</div>
|
||||||
<h2 class="Section">Requirements</h2>
|
<h2 class="Section">Requirements</h2>
|
||||||
<div class="SectionBox" id="M:WebSocketSharp.Ext.ToBytes``1(``0,WebSocketSharp.ByteOrder):Version Information">
|
<div class="SectionBox" id="M:WebSocketSharp.Ext.ToByteArray``1(``0,WebSocketSharp.ByteOrder):Version Information">
|
||||||
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
|
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
|
||||||
<hr size="1" />
|
<hr size="1" />
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
@ -1181,9 +1181,9 @@
|
|||||||
</exception>
|
</exception>
|
||||||
</Docs>
|
</Docs>
|
||||||
</Member>
|
</Member>
|
||||||
<Member MemberName="ToBytes<T>">
|
<Member MemberName="ToByteArray<T>">
|
||||||
<MemberSignature Language="C#" Value="public static byte[] ToBytes<T> (this T value, WebSocketSharp.ByteOrder order) where T : struct;" />
|
<MemberSignature Language="C#" Value="public static byte[] ToByteArray<T> (this T value, WebSocketSharp.ByteOrder order) where T : struct;" />
|
||||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig unsigned int8[] ToBytes<struct .ctor (class System.ValueType) T>(!!T value, valuetype WebSocketSharp.ByteOrder order) cil managed" />
|
<MemberSignature Language="ILAsm" Value=".method public static hidebysig unsigned int8[] ToByteArray<struct .ctor (class System.ValueType) T>(!!T value, valuetype WebSocketSharp.ByteOrder order) cil managed" />
|
||||||
<MemberType>Method</MemberType>
|
<MemberType>Method</MemberType>
|
||||||
<ReturnValue>
|
<ReturnValue>
|
||||||
<ReturnType>System.Byte[]</ReturnType>
|
<ReturnType>System.Byte[]</ReturnType>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<Overview>
|
<Overview>
|
||||||
<Assemblies>
|
<Assemblies>
|
||||||
<Assembly Name="websocket-sharp" Version="1.0.2.28404">
|
<Assembly Name="websocket-sharp" Version="1.0.2.26272">
|
||||||
<AssemblyPublicKey>[00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 11 00 00 00 29 17 fb 89 fe c3 91 f7 2b cb 8b e2 61 d2 3f 05 93 6d 65 a8 9e 63 72 a6 f5 d5 2c f2 9d 20 fa 0b c0 70 6a f6 88 7e 8b 90 3f 39 f5 76 c8 48 e0 bb 7b b2 7b ed d3 10 a7 1a 0f 70 98 0f 7f f4 4b 53 09 d2 a5 ef 36 c3 56 b4 aa f0 91 72 63 25 07 89 e0 93 3e 3f 2e f2 b9 73 0e 12 15 5d 43 56 c3 f4 70 a5 89 fe f7 f6 ac 3e 77 c2 d8 d0 84 91 f4 0c d1 f3 8e dc c3 c3 b8 38 3d 0c bf 17 de 20 78 c1 ]</AssemblyPublicKey>
|
<AssemblyPublicKey>[00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 11 00 00 00 29 17 fb 89 fe c3 91 f7 2b cb 8b e2 61 d2 3f 05 93 6d 65 a8 9e 63 72 a6 f5 d5 2c f2 9d 20 fa 0b c0 70 6a f6 88 7e 8b 90 3f 39 f5 76 c8 48 e0 bb 7b b2 7b ed d3 10 a7 1a 0f 70 98 0f 7f f4 4b 53 09 d2 a5 ef 36 c3 56 b4 aa f0 91 72 63 25 07 89 e0 93 3e 3f 2e f2 b9 73 0e 12 15 5d 43 56 c3 f4 70 a5 89 fe f7 f6 ac 3e 77 c2 d8 d0 84 91 f4 0c d1 f3 8e dc c3 c3 b8 38 3d 0c bf 17 de 20 78 c1 ]</AssemblyPublicKey>
|
||||||
<Attributes>
|
<Attributes>
|
||||||
<Attribute>
|
<Attribute>
|
||||||
@ -1324,9 +1324,9 @@
|
|||||||
<Targets>
|
<Targets>
|
||||||
<Target Type="T:System.ValueType" />
|
<Target Type="T:System.ValueType" />
|
||||||
</Targets>
|
</Targets>
|
||||||
<Member MemberName="ToBytes<T>">
|
<Member MemberName="ToByteArray<T>">
|
||||||
<MemberSignature Language="C#" Value="public static byte[] ToBytes<T> (this T value, WebSocketSharp.ByteOrder order) where T : struct;" />
|
<MemberSignature Language="C#" Value="public static byte[] ToByteArray<T> (this T value, WebSocketSharp.ByteOrder order) where T : struct;" />
|
||||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig unsigned int8[] ToBytes<struct .ctor (class System.ValueType) T>(!!T value, valuetype WebSocketSharp.ByteOrder order) cil managed" />
|
<MemberSignature Language="ILAsm" Value=".method public static hidebysig unsigned int8[] ToByteArray<struct .ctor (class System.ValueType) T>(!!T value, valuetype WebSocketSharp.ByteOrder order) cil managed" />
|
||||||
<MemberType>ExtensionMethod</MemberType>
|
<MemberType>ExtensionMethod</MemberType>
|
||||||
<ReturnValue>
|
<ReturnValue>
|
||||||
<ReturnType>System.Byte[]</ReturnType>
|
<ReturnType>System.Byte[]</ReturnType>
|
||||||
@ -1358,7 +1358,7 @@
|
|||||||
Converts the specified data to an array of <see cref="T:System.Byte" />.
|
Converts the specified data to an array of <see cref="T:System.Byte" />.
|
||||||
</summary>
|
</summary>
|
||||||
</Docs>
|
</Docs>
|
||||||
<Link Type="WebSocketSharp.Ext" Member="M:WebSocketSharp.Ext.ToBytes``1(``0,WebSocketSharp.ByteOrder)" />
|
<Link Type="WebSocketSharp.Ext" Member="M:WebSocketSharp.Ext.ToByteArray``1(``0,WebSocketSharp.ByteOrder)" />
|
||||||
</Member>
|
</Member>
|
||||||
</ExtensionMethod>
|
</ExtensionMethod>
|
||||||
<ExtensionMethod>
|
<ExtensionMethod>
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user