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
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,15 +18,15 @@ This API mirrors (as close as possible) the official .NET [System.Net.WebSockets
18
18
19
19
## Samples
20
20
21
-
### WebSockets Server Sample
21
+
### WebSockets Server Sample
22
22
23
23
[Server.RgbSample](https://github.com/nanoframework/Samples/tree/main/samples/WebSockets/WebSockets.Server.RgbSample) shows howto use Websocket Server with a Webserver hosting a WebApp that controlls the rgb led on an Atom Lite ESP32.
24
24
25
-
### WebSockets Client Sample
25
+
### WebSockets Client Sample
26
26
27
27
[Client.Sample](https://github.com/nanoframework/Samples/tree/main/samples/WebSockets/Websockets.ServerClient.Sample) shows how to use the Websocket Client.
28
28
29
-
### WebSockets Server and Client sample
29
+
### WebSockets Server and Client sample
30
30
31
31
[ServerClient.Sample](https://github.com/nanoframework/Samples/tree/main/samples/WebSockets/Websockets.ServerClient.Sample) shows how to configure and start a WebSocket Server and (ssl) Client.
32
32
@@ -99,7 +99,7 @@ namespace NFWebsocketTestClient
99
99
100
100
The connection state can be monitored by checking the ClientWebSocket `State`. After the connection is established the state is set to `Open`. The client is only able to send messages if the state is Open.
101
101
102
-
#### Receiving messages
102
+
#### Receiving messages from server
103
103
104
104
Messages can be received by setting an event handler for `MessageReceived`. This handler will be called every time a message is received. The `MesageReceivedArguments` contains the `MessageReceivedFrame` with a buffer containing the message.
105
105
@@ -122,7 +122,7 @@ Whenever a connection is closed the event `Closed` is fired.
122
122
123
123
The `WebSocketServer` is a websocket host for .NET nanoFramework that can handle multiple websocket connections. The server can be run stand alone or be integrated with the nanoFramework [HttpListner](https://github.com/nanoframework/System.Net.Http/blob/develop/nanoFramework.System.Net.Http/Http/System.Net.HttpListener.cs) or [WebServer](https://github.com/nanoframework/nanoFramework.WebServer).
124
124
The server shares a common websocket base with the Client implementation.
125
-
125
+
126
126
#### Creating a server
127
127
128
128
To start a new server, create a `WebsocketServer` with optional `WebSocketServerOptions`. By default this will start a selfhosted server on port 80, by setting the `Prefix` and `Port` options you can specify on what port and what prefix this server will listen. The default prefix is `/`. It's recommended to set the `MaxClients` to make sure the server does not run out of resources.
@@ -176,7 +176,7 @@ When a client connection is closed the `WebsocketClosed` event is called again c
176
176
177
177
You can close a specific client connection by calling `DisconnectClient`. You need to specify what client you want to disconnect by providing the client endpoint. Also you need to specify an appropriate `WebSocketCloseStatus`.
178
178
179
-
#### Receiving messages
179
+
#### Receiving messages from clients
180
180
181
181
When a message from any client is received the `MessageReceived` is raised. Please see the Client section [Receiving Messages](#receiving_messages) and [Message Frame](#message_frame) on how to handle messages. The client who send the message can be identified by checking `Endpoint` property of the `MessageFrame`.
182
182
@@ -207,6 +207,6 @@ The **nanoFramework** Class Libraries are licensed under the [MIT license](LICEN
207
207
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behaviour in our community.
208
208
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
209
209
210
-
###.NET Foundation
210
+
## .NET Foundation
211
211
212
212
This project is supported by the [.NET Foundation](https://dotnetfoundation.org).
0 commit comments