Modified some part (Step 1 and 2) of 'WebSocket Server'
This commit is contained in:
parent
a90716ab15
commit
b3f5cdd41b
10
README.md
10
README.md
@ -260,13 +260,13 @@ Required namespace.
|
|||||||
using WebSocketSharp.Server;
|
using WebSocketSharp.Server;
|
||||||
```
|
```
|
||||||
|
|
||||||
The `WebSocketService` and `WebSocketServer` classes exist in the `WebSocketSharp.Server` namespace.
|
The `WebSocketServer` and `WebSocketService` classes exist in the `WebSocketSharp.Server` namespace.
|
||||||
|
|
||||||
#### Step 2 ####
|
#### Step 2 ####
|
||||||
|
|
||||||
Creating the class that inherits the `WebSocketService` class.
|
Creating the class that inherits the `WebSocketService` class.
|
||||||
|
|
||||||
For example, if you provide an echo service,
|
For example, if you want to provide an echo service,
|
||||||
|
|
||||||
```cs
|
```cs
|
||||||
using System;
|
using System;
|
||||||
@ -282,7 +282,7 @@ public class Echo : WebSocketService
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
And if you provide a chat service,
|
And if you want to provide a chat service,
|
||||||
|
|
||||||
```cs
|
```cs
|
||||||
using System;
|
using System;
|
||||||
@ -314,11 +314,11 @@ If you override the `WebSocketService.OnMessage` method, it's bound to the serve
|
|||||||
|
|
||||||
And if you override the `WebSocketService.OnOpen`, `WebSocketService.OnError` and `WebSocketService.OnClose` methods, each of them is bound to each server side event of `WebSocket.OnOpen`, `WebSocket.OnError` and `WebSocket.OnClose`.
|
And if you override the `WebSocketService.OnOpen`, `WebSocketService.OnError` and `WebSocketService.OnClose` methods, each of them is bound to each server side event of `WebSocket.OnOpen`, `WebSocket.OnError` and `WebSocket.OnClose`.
|
||||||
|
|
||||||
The `WebSocketService.Send` method sends a data to the client of the current session to the WebSocket service.
|
The `WebSocketService.Send (data)` method sends a data to the client of the current session to the WebSocket service.
|
||||||
|
|
||||||
The `WebSocketService.Sessions` (its type is `WebSocketSharp.Server.WebSocketSessionManager`) property provides some functions for the sessions to the WebSocket service.
|
The `WebSocketService.Sessions` (its type is `WebSocketSharp.Server.WebSocketSessionManager`) property provides some functions for the sessions to the WebSocket service.
|
||||||
|
|
||||||
The `WebSocketService.Sessions.Broadcast` method sends a data to all clients of the WebSocket service.
|
The `WebSocketService.Sessions.Broadcast (data)` method broadcasts a data to all clients of the WebSocket service.
|
||||||
|
|
||||||
#### Step 3 ####
|
#### Step 3 ####
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user