mirror of
https://github.com/yawaflua/WebSockets.git
synced 2025-12-08 19:39:30 +02:00
16 lines
510 B
C#
16 lines
510 B
C#
using yawaflua.WebSockets.Attributes;
|
|
using yawaflua.WebSockets.Models.Abstracts;
|
|
using yawaflua.WebSockets.Models.Interfaces;
|
|
|
|
namespace Examples;
|
|
|
|
[WebSocket("/test")]
|
|
public class TestWebSocketServer : WebSocketController
|
|
{
|
|
|
|
[WebSocket("/sub-test")]
|
|
public override async Task OnMessageAsync(IWebSocket webSocket, HttpContext httpContext)
|
|
{
|
|
await webSocket.SendAsync("Test! Now on it endpoint: " + WebSocketManager.GetAllClients().Count(k => k.Path == webSocket.Client.Path));
|
|
}
|
|
} |