You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`e` has passed as a `WebSocketSharp.MessageEventArgs`.
140
140
141
-
`e.Type` property returns either `WebSocketSharp.Opcode.Text` or `WebSocketSharp.Opcode.Binary` that represents the message type. So by checking it, you can determine which item you should use.
141
+
If you would like to get the message data, you should access `e.Data` or `e.RawData` property. And you can determine which property you should access by checking `e.IsText` or `e.IsBinary` property.
142
142
143
-
If it returns `Opcode.Text`, you should use`e.Data` property that returns a `string` (represents a **text** message).
143
+
If `e.IsText` is `true`, you should access`e.Data` that returns a `string` (represents a **text** message).
144
144
145
-
Or if it returns `Opcode.Binary`, you should use`e.RawData` property that returns a `byte[]` (represents a **binary** message).
145
+
Or if `e.IsBinary` is `true`, you should access`e.RawData` that returns a `byte[]` (represents a **binary** message).
146
146
147
147
```csharp
148
-
if (e.Type==Opcode.Text) {
148
+
if (e.IsText) {
149
149
// Do something with e.Data.
150
150
...
151
151
152
152
return;
153
153
}
154
154
155
-
if (e.Type==Opcode.Binary) {
155
+
if (e.IsBinary) {
156
156
// Do something with e.RawData.
157
157
...
158
158
@@ -165,14 +165,12 @@ And if you would like to notify that a **ping** has been received, via this even
165
165
```csharp
166
166
ws.EmitOnPing=true;
167
167
ws.OnMessage+= (sender, e) => {
168
-
if (e.Type==Opcode.Ping) {
168
+
if (e.IsPing) {
169
169
// Do something to notify that a ping has been received.
0 commit comments