/sse_asp_dotnet_core

Donate me: https://www.paypal.com/paypalme/dunp211284

Primary LanguageC#MIT LicenseMIT

server send event with asp dotnet core

Pull code then all code sample in side folder SSE.web

You have to know about asp dotnet core framework version 3.1

ServerSendEventHub.cs

  • Keep client connected group by channel
  • Provide function to push data when other post to channel
  • When channel got message, broadcast to all client

check server side code SSEController function Listener

ServerSendEventHub.RegisterListenerClientContext

check server side code SSEController function SendMessage

ServerSendEventHub.Publish

check javascript usage SharedWorker

SSE.web\Views\Home\Index.cshtml

SSE

SSE.web\wwwroot\js\webpushnotification\eventsourcereceiver.js

SharedWorker

SSE.web\wwwroot\js\webpushnotification\notificationwebsharedworker.js