If `e.Type` is `Opcode.Text`, you should use `e.Data` property (returns a `string`) that represents the received **Text** message.
Or if `e.Type` is `Opcode.Binary`, you should use `e.RawData` property (returns a `byte[]`) that represents the received **Binary** message.
Or if `e.Type` is `Opcode.Binary`, you should use `e.RawData` property (returns a `byte[]`) that represents the received **Binary** message.
```cs
if (e.Type == Opcode.Text) {
@ -179,7 +179,7 @@ ws.OnClose += (sender, e) => {
`e` has passed as a `WebSocketSharp.CloseEventArgs`.
`e.Code` property returns a `ushort` that represents the status code indicating the reason for closure, and `e.Reason` property returns a `string` that represents the reason for closure. So you should use them to get the reason for closure.
`e.Code` property returns a `ushort` that represents the status code indicating the reason for the close, and `e.Reason` property returns a `string` that represents the reason for the close. So you should use them to get the reason for the close.
#### Step 4 ####
@ -201,7 +201,7 @@ ws.Send (data);
The `WebSocket.Send` method is overloaded.
You can use the `WebSocket.Send (string)`, `WebSocket.Send (byte[])`, or `WebSocket.Send (System.IO.FileInfo)` method to send a data.
You can use the `WebSocket.Send (string)`, `WebSocket.Send (byte[])`, or `WebSocket.Send (System.IO.FileInfo)` method to send a data.
If you would like to send a data asynchronously, you should use the `WebSocket.SendAsync` method.
@ -250,7 +250,7 @@ namespace Example
public class Program
{
public static void Main (string[] args)
public static void Main (string[] args)
{
var wssv = new WebSocketServer ("ws://dragonsnest.far");
wssv.AddWebSocketService<Laputa> ("/Laputa");
@ -338,7 +338,7 @@ Creating an instance of the `WebSocketServer` class.
var wssv = new WebSocketServer (4649);
wssv.AddWebSocketService<Echo> ("/Echo");
wssv.AddWebSocketService<Chat> ("/Chat");
wssv.AddWebSocketService<Chat> ("/ChatWithNiceBoat", () => new Chat (" Nice boat."));
wssv.AddWebSocketService<Chat> ("/ChatWithNyan", () => new Chat (" Nyan."));
```
You can add any WebSocket service to your `WebSocketServer` with the specified path to the service, using the `WebSocketServer.AddWebSocketService<TWithNew> (string)` or `WebSocketServer.AddWebSocketService<T> (string, Func<T>)` method.
@ -385,7 +385,7 @@ You can add any WebSocket service to your `HttpServer` with the specified path t
var httpsv = new HttpServer (4649);
httpsv.AddWebSocketService<Echo> ("/Echo");
httpsv.AddWebSocketService<Chat> ("/Chat");
httpsv.AddWebSocketService<Chat> ("/ChatWithNiceBoat", () => new Chat (" Nice boat."));
httpsv.AddWebSocketService<Chat> ("/ChatWithNyan", () => new Chat (" Nyan."));
```
For more information, could you see **[Example3]**?
@ -457,9 +457,9 @@ As a **WebSocket Server**, you should set an HTTP authentication scheme, a realm