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: BlazorSignalRApp/README.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,21 @@
3
3
Sample application to demonstrate integrating web sockets into a balzor server application using [SignalR](https://learn.microsoft.com/en-us/aspnet/core/signalr/introduction?view=aspnetcore-7.0).
4
4
5
5
## Code Organization
6
-
-**Hubs** - Hubs define the methods that will be exposed as RPCs to the clinet to invoke or subscribe to, these hubs are stateless in nature and get distroyed and created inline with the life cycle of the UI component
6
+
-**Hubs** - Hubs define the methods that will be exposed as RPCs to the client to invoke or subscribe to, these hubs are stateless in nature and get destroyed and created in-line with the life cycle of the UI component
7
7
-**Data** - Data classes are used to define the format of data that will be transmitted over the SignalR hubs.
8
8
-**Pages** - Pages represent the razor pages that will consume data from SignalR.
9
9
10
10
## Steps For WebSockets
11
11
-**Step 1** Install Nuget Package [Microsoft.AspNetCore.SignalR.Client ](https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR.Client), Make sure to install the Client library and not the named Core.
12
-
-**Step 2** Configure the server to be able to octect streams to send data over websockets and initialize the SignalR Hubs in the "Program.cs" file. Make sure to import the requrired namespaces form the isntalled nuget package
12
+
-**Step 2** Configure the server to be able to octet streams to send data over web sockets and initialize the SignalR Hubs in the "Program.cs" file. Make sure to import the required name spaces form the installed nuget package
});//Configure server to send respones as octet stream over websockets
20
+
});//Configure server to send response as octet stream over web sockets
21
21
```
22
22
23
23
```
@@ -27,7 +27,7 @@ Sample application to demonstrate integrating web sockets into a balzor server a
27
27
//options.TransportMaxBufferSize = 131072;
28
28
});
29
29
```
30
-
- **Step 3** Define Hubs for data transfer, Hubs cab be a good way to organize diffrent data streams. Methods exposed by the hub can be invoked from razor pages to transfer data back to the server.
30
+
- **Step 3** Define Hubs for data transfer, Hubs cab be a good way to organize different data streams. Methods exposed by the hub can be invoked from razor pages to transfer data back to the server.
31
31
```
32
32
public class PlotHub : Hub
33
33
{
@@ -50,11 +50,11 @@ Sample application to demonstrate integrating web sockets into a balzor server a
50
50
}
51
51
}
52
52
```
53
-
- **Step 4** Use the "SendAsync" method to send data to all the registerd clients from the server. The method named defined here is used in the razor pages to hook up call back methods when data is made available on these streams.
53
+
- **Step 4** Use the "SendAsync" method to send data to all the registered clients from the server. The method named defined here is used in the razor pages to hook up call back methods when data is made available on these streams.
- **Step 5** Overide the "OnInitializedAsync" life cycle method to setup connection the signalR hub and configure the call back methods for the streams that are of intrest to the component.
57
+
- **Step 5** Override the "OnInitializedAsync" life cycle method to setup connection the signalR hub and configure the call back methods for the streams that are of interest to the component.
0 commit comments