Class WebSocketService
- Namespace
- Virtufin.WebSocketManager.Services
- Assembly
- Virtufin.WebSocketManager.dll
public class WebSocketService : IWebSocketService
- Inheritance
-
WebSocketService
- Implements
-
- Inherited Members
-
Constructors
WebSocketService(IWebSocketConnectionStore, IWebSocketClientWrapper, IDaprPublisher, IInstanceIdProvider, ILogger<WebSocketService>)
public WebSocketService(IWebSocketConnectionStore connectionStore, IWebSocketClientWrapper webSocketClient, IDaprPublisher daprPublisher, IInstanceIdProvider instanceIdProvider, ILogger<WebSocketService> logger)
Parameters
connectionStore IWebSocketConnectionStore
webSocketClient IWebSocketClientWrapper
daprPublisher IDaprPublisher
instanceIdProvider IInstanceIdProvider
logger ILogger<WebSocketService>
Methods
ConnectAsync(string, bool, CancellationToken)
public Task<WebSocketConnection> ConnectAsync(string url, bool autoReconnect, CancellationToken cancellationToken = default)
Parameters
url string
autoReconnect bool
cancellationToken CancellationToken
Returns
- Task<WebSocketConnection>
DisconnectAsync(string, CancellationToken)
public Task DisconnectAsync(string id, CancellationToken cancellationToken = default)
Parameters
id string
cancellationToken CancellationToken
Returns
- Task
ListConnectionsAsync(CancellationToken)
public Task<IEnumerable<WebSocketConnection>> ListConnectionsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken CancellationToken
Returns
- Task<IEnumerable<WebSocketConnection>>
SendAsync(string, byte[], int, string, CancellationToken)
public Task<byte[]> SendAsync(string id, byte[] message, int timeoutMs, string contentType, CancellationToken cancellationToken = default)
Parameters
id string
message byte[]
timeoutMs int
contentType string
cancellationToken CancellationToken
Returns
- Task<byte[]>
SendRawAsync(string, byte[], string, CancellationToken)
public Task SendRawAsync(string id, byte[] message, string contentType, CancellationToken cancellationToken = default)
Parameters
id string
message byte[]
contentType string
cancellationToken CancellationToken
Returns
- Task
StartPublishAsync(string, string, CancellationToken)
public Task StartPublishAsync(string id, string topic, CancellationToken cancellationToken = default)
Parameters
id string
topic string
cancellationToken CancellationToken
Returns
- Task
StopPublishAsync(string, CancellationToken)
public Task StopPublishAsync(string id, CancellationToken cancellationToken = default)
Parameters
id string
cancellationToken CancellationToken
Returns
- Task