From 9dfa3539cfc25de3ddc4f5a5692f4cdef4c4703b Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 26 Feb 2014 17:02:26 +0900 Subject: [PATCH] Fix a few --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 13af5ff7..eebdcdae 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Welcome to websocket-sharp! ## -**websocket-sharp** supports the followings: +**websocket-sharp** supports: - **[WebSocket Client](#websocket-client)** and **[Server](#websocket-server)** - **[RFC 6455](#supported-websocket-specifications)** @@ -116,7 +116,7 @@ ws.OnOpen += (sender, e) => { ##### WebSocket.OnMessage Event ##### -A `WebSocket.OnMessage` event occurs when the `WebSocket` receives a WebSocket message. +A `WebSocket.OnMessage` event occurs when the `WebSocket` receives a message. ```cs ws.OnMessage += (sender, e) => { @@ -170,7 +170,7 @@ ws.OnClose += (sender, e) => { `e` has passed as a `WebSocketSharp.CloseEventArgs`. -`e.Code` property returns a `ushort` that represents the status code that indicates 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 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. #### Step 4 #### @@ -311,15 +311,15 @@ public class Chat : WebSocketService } ``` -If you override the `WebSocketService.OnMessage (MessageEventArgs)` method, that overridden method is called when the `OnMessage` event of the current session's `WebSocket` occurs. +If you override the `WebSocketService.OnMessage (MessageEventArgs)` method, it's called when the `OnMessage` event of the `WebSocket` used by the current session in the WebSocket service occurs. -And if you override the `WebSocketService.OnOpen ()`, `WebSocketService.OnError (ErrorEventArgs)`, and `WebSocketService.OnClose (CloseEventArgs)` methods, each of them is called when each event of the current session's `WebSocket` (the `OnOpen`, `OnError`, and `OnClose` events) occurs. +And if you override the `WebSocketService.OnOpen ()`, `WebSocketService.OnError (ErrorEventArgs)`, and `WebSocketService.OnClose (CloseEventArgs)` methods, each of them is called when each event of the `WebSocket` (the `OnOpen`, `OnError`, and `OnClose`) occurs. The `WebSocketService.Send` method sends a data to the client on the current session in the WebSocket service. If you would like to access the sessions in the WebSocket service, you should use the `WebSocketService.Sessions` property (returns a `WebSocketSharp.Server.WebSocketSessionManager`). -The `WebSocketService.Sessions.Broadcast` method broadcasts a data to all clients of the WebSocket service. +The `WebSocketService.Sessions.Broadcast` method broadcasts a data to every client in the WebSocket service. #### Step 3 #### @@ -332,7 +332,7 @@ wssv.AddWebSocketService ("/Chat"); wssv.AddWebSocketService ("/ChatWithNiceBoat", () => new Chat (" Nice boat.")); ``` -You can add any WebSocket service to your `WebSocketServer` with the specified path to the service, using the `WebSocketServer.AddWebSocketService (string)` and `WebSocketServer.AddWebSocketService (string, Func)` methods. +You can add any WebSocket service to your `WebSocketServer` with the specified path to the service, using the `WebSocketServer.AddWebSocketService (string)` or `WebSocketServer.AddWebSocketService (string, Func)` method. The type of `TWithNew` must inherit the `WebSocketService` class and must have a public parameterless constructor. @@ -370,7 +370,7 @@ I modified the `System.Net.HttpListener`, `System.Net.HttpListenerContext`, and So websocket-sharp provides the `WebSocketSharp.Server.HttpServer` class. -You can add any WebSocket service to your `HttpServer` with the specified path to the service, using the `HttpServer.AddWebSocketService (string)` and `HttpServer.AddWebSocketService (string, Func)` methods. +You can add any WebSocket service to your `HttpServer` with the specified path to the service, using the `HttpServer.AddWebSocketService (string)` or `HttpServer.AddWebSocketService (string, Func)` method. ```cs var httpsv = new HttpServer (4649);