WebSocket messages will be sent to all connected
This commit is contained in:
15
pac-man-board-game/Interfaces/IWebSocketService.cs
Normal file
15
pac-man-board-game/Interfaces/IWebSocketService.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Net.WebSockets;
|
||||
|
||||
namespace pacMan.Interfaces;
|
||||
|
||||
public interface IWebSocketService
|
||||
{
|
||||
void Add(WebSocket webSocket);
|
||||
void Remove(WebSocket webSocket);
|
||||
Task Send(WebSocket webSocket, string message, int length);
|
||||
Task Send(WebSocket webSocket, byte[] message, int length);
|
||||
Task SendToAll(string message, int length);
|
||||
Task SendToAll(byte[] message, int length);
|
||||
Task<WebSocketReceiveResult> Receive(WebSocket webSocket, byte[] buffer);
|
||||
Task Close(WebSocket webSocket, WebSocketCloseStatus closeStatus, string closeStatusDescription);
|
||||
}
|
Reference in New Issue
Block a user