mirror of
https://github.com/yawaflua/WebSockets.git
synced 2025-12-16 01:46:19 +02:00
Create project files
This commit is contained in:
15
yawaflua.WebSockets/Models/Interfaces/IWebSocketClient.cs
Normal file
15
yawaflua.WebSockets/Models/Interfaces/IWebSocketClient.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.Net.WebSockets;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace yawaflua.WebSockets.Models.Interfaces;
|
||||
|
||||
public interface IWebSocketClient
|
||||
{
|
||||
public Guid Id { get; }
|
||||
public string Path { get; }
|
||||
public ConnectionInfo? ConnectionInfo { get; }
|
||||
public IDictionary<object, object>? Items { get; set; }
|
||||
public HttpRequest? HttpRequest { get; }
|
||||
internal WebSocket webSocket { get; }
|
||||
public Task Abort();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using yawaflua.WebSockets.Core;
|
||||
|
||||
namespace yawaflua.WebSockets.Models.Interfaces;
|
||||
|
||||
internal interface IWebSocketController
|
||||
{
|
||||
Task OnMessageAsync(WebSocket webSocket, HttpContext httpContext);
|
||||
}
|
||||
11
yawaflua.WebSockets/Models/Interfaces/IWebSocketManager.cs
Normal file
11
yawaflua.WebSockets/Models/Interfaces/IWebSocketManager.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.Linq.Expressions;
|
||||
using System.Net.WebSockets;
|
||||
|
||||
namespace yawaflua.WebSockets.Models.Interfaces;
|
||||
|
||||
public interface IWebSocketManager
|
||||
{
|
||||
public Task Broadcast(Func<IWebSocketClient, bool> selector,string message, WebSocketMessageType messageType = WebSocketMessageType.Text, CancellationToken cts = default);
|
||||
public List<IWebSocketClient> GetAllClients();
|
||||
public Task SendToUser(Guid id, string message, WebSocketMessageType messageType, CancellationToken cts);
|
||||
}
|
||||
Reference in New Issue
Block a user