diff --git a/Example/bin/Debug_Ubuntu/example.exe b/Example/bin/Debug_Ubuntu/example.exe index a0f9a695..836ea181 100755 Binary files a/Example/bin/Debug_Ubuntu/example.exe and b/Example/bin/Debug_Ubuntu/example.exe differ diff --git a/Example/bin/Debug_Ubuntu/websocket-sharp.dll b/Example/bin/Debug_Ubuntu/websocket-sharp.dll index 06cb0344..af86fa4b 100755 Binary files a/Example/bin/Debug_Ubuntu/websocket-sharp.dll and b/Example/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/Example1/bin/Debug_Ubuntu/example1.exe b/Example1/bin/Debug_Ubuntu/example1.exe index 1a461ee5..5d0f28e2 100755 Binary files a/Example1/bin/Debug_Ubuntu/example1.exe and b/Example1/bin/Debug_Ubuntu/example1.exe differ diff --git a/Example1/bin/Debug_Ubuntu/websocket-sharp.dll b/Example1/bin/Debug_Ubuntu/websocket-sharp.dll index 06cb0344..af86fa4b 100755 Binary files a/Example1/bin/Debug_Ubuntu/websocket-sharp.dll and b/Example1/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/Example2/bin/Debug_Ubuntu/example2.exe b/Example2/bin/Debug_Ubuntu/example2.exe index 1a87d99b..04aae284 100755 Binary files a/Example2/bin/Debug_Ubuntu/example2.exe and b/Example2/bin/Debug_Ubuntu/example2.exe differ diff --git a/Example2/bin/Debug_Ubuntu/websocket-sharp.dll b/Example2/bin/Debug_Ubuntu/websocket-sharp.dll index 06cb0344..af86fa4b 100755 Binary files a/Example2/bin/Debug_Ubuntu/websocket-sharp.dll and b/Example2/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/Example3/bin/Debug_Ubuntu/Example3.exe b/Example3/bin/Debug_Ubuntu/Example3.exe index b2d0f3c6..7428ea68 100755 Binary files a/Example3/bin/Debug_Ubuntu/Example3.exe and b/Example3/bin/Debug_Ubuntu/Example3.exe differ diff --git a/Example3/bin/Debug_Ubuntu/websocket-sharp.dll b/Example3/bin/Debug_Ubuntu/websocket-sharp.dll index 06cb0344..af86fa4b 100755 Binary files a/Example3/bin/Debug_Ubuntu/websocket-sharp.dll and b/Example3/bin/Debug_Ubuntu/websocket-sharp.dll differ diff --git a/websocket-sharp/MessageEventArgs.cs b/websocket-sharp/MessageEventArgs.cs index 073923d0..25804b93 100644 --- a/websocket-sharp/MessageEventArgs.cs +++ b/websocket-sharp/MessageEventArgs.cs @@ -56,12 +56,14 @@ namespace WebSocketSharp { if ((ulong)rawData.LongLength > PayloadData.MaxLength) throw new WebSocketException(CloseStatusCode.TOO_BIG); - init(opcode, rawData); + _opcode = opcode; + _rawData = rawData; } internal MessageEventArgs(Opcode opcode, PayloadData data) { - init(opcode, data.ApplicationData); + _opcode = opcode; + _rawData = data.ApplicationData; } #endregion @@ -76,8 +78,13 @@ namespace WebSocketSharp { /// public string Data { get { - if (_data.IsNull()) - _data = toString(_opcode, _rawData); + _data = _data != null + ? _data + : _rawData.LongLength == 0 + ? String.Empty + : _opcode == Opcode.TEXT + ? Encoding.UTF8.GetString(_rawData) + : _opcode.ToString(); return _data; } @@ -108,25 +115,5 @@ namespace WebSocketSharp { } #endregion - - #region Private Methods - - private void init(Opcode opcode, byte[] rawData) - { - _opcode = opcode; - _rawData = rawData; - } - - private static string toString(Opcode opcode, byte[] rawData) - { - if (rawData.LongLength == 0) - return String.Empty; - - return opcode == Opcode.TEXT || opcode == Opcode.PING || opcode == Opcode.PONG - ? Encoding.UTF8.GetString(rawData) - : opcode.ToString(); - } - - #endregion } } diff --git a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll index 06cb0344..af86fa4b 100755 Binary files a/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll and b/websocket-sharp/bin/Debug_Ubuntu/websocket-sharp.dll differ