Class WebSocketController
- Namespace
- DuetWebServer.Controllers
- Assembly
- DuetWebServer.dll
MVC controller for WebSocket requests
[ApiController]
[Route("machine")]
public class WebSocketController : ControllerBase
- Inheritance
-
WebSocketController
- Inherited Members
Constructors
WebSocketController(IConfiguration, ILogger<WebSocketController>, IHostApplicationLifetime)
MVC controller for WebSocket requests
public WebSocketController(IConfiguration configuration, ILogger<WebSocketController> logger, IHostApplicationLifetime applicationLifetime)
Parameters
configurationIConfigurationConfiguration of this application
loggerILogger<WebSocketController>Logger instance
applicationLifetimeIHostApplicationLifetimeApplication lifecycle instance
Methods
Get(string?, ISessionStorage)
WS /machine?sessionKey=XXX Provide WebSocket for continuous model updates. This is primarily used to keep DWC up-to-date
[HttpGet]
public Task Get(string? sessionKey, ISessionStorage sessionStorage)
Parameters
sessionKeystringOptional session key for authentication
sessionStorageISessionStorageSession storage singleton
Returns
- Task
HTTP status code: (101) WebSocket upgrade (400) Bad request (403) Forbidden (500) Generic error (502) Incompatible DCS version (503) DCS is not started