Use WebSocket methods in situations where bidirectional, event controlled communications is required. You define the processing as well as input and output data within the WebSocket method.
NOTE: When the session ends or the server, all open WebSocket connections are also closed.
For examples of WebSocket methods, see the SDK under Sdk01_Basics\19-WebSockets.cs.
For more information about WebSocket implementation, see https://learn.microsoft.com/en-us/dotnet/api/system.net.websockets.websocket?view=net-8.0.