public sealed class SystemWebSocketFactoryReal WebSockets, over real sockets.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Thin on purpose, like the UDP transport's socket adapter: everything that could be got wrong lives above the seam and is tested over an in-memory pair. What is left here is an upgrade handshake and the async-to-polled adaptation, and both are the kind of thing that is either right or obviously broken.
A TcpListener and the framework's own framing, rather than HttpListener. The upgrade is thirty lines of RFC 6455 — a SHA-1 of the client's key and a fixed GUID — and doing it here avoids HttpListener's URL-reservation behaviour on Windows and its uneven support elsewhere. The framing underneath is WebSocket.CreateFromStream, which is the part worth not writing.
The threads stop at this interface. A WebSocket is asynchronous and the transport contract says nothing is delivered outside Poll, so each channel runs its own receive and send loops and hands over queues. Nothing above ever sees a task.
Methods (2)
public IWebSocketListener Listen(Uri address)Starts listening.
public IWebSocketChannel Connect(Uri address)Opens a channel.
Used by (1)
- RealWebSocketTestsVixen.Net.Transport.WebSocket.Tests