Vixen
02b45cc4
csharp
public interface IWebSocketChannel

One WebSocket, as the transport needs it.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The seam, and it is the same bargain IDatagramSocket makes in the UDP transport: everything that could be got wrong lives above it and is tested over an in-memory implementation where a message arrives when the receiver polls and every run is the same run. What is left here is a handshake and a frame codec, which is somebody else's tested code.

Message-oriented and polled, where the real thing is stream-oriented and asynchronous. WebSocket already gives message boundaries, so nothing above needs to re-invent them; the polling is what keeps the transport contract's promise that nothing is delivered outside Poll. A real implementation runs its own I/O and queues what arrives — the threads are inside this interface, and the layer above never sees one.

Fields and properties (1)

Methods (4)

  • void Send(ReadOnlySpan<byte> message)

    Queues a message.

  • bool TryReceive(Span<byte> buffer, out int length)

    Takes the next message that arrived.

  • void Close()

    Starts closing, politely.

  • void Pump()

    Moves whatever this implementation moves on a poll.

Used by (10)

  • ChannelVixen.Net.Transport.WebSocket.Tests
  • IWebSocketFactoryVixen.Net.Transport.WebSocket
  • IWebSocketListenerVixen.Net.Transport.WebSocket
  • ListenerVixen.Net.Transport.WebSocket.Tests
  • PeerVixen.Net.Transport.WebSocket
  • SystemWebSocketChannelVixen.Net.Transport.WebSocket
  • SystemWebSocketFactoryVixen.Net.Transport.WebSocket
  • SystemWebSocketListenerVixen.Net.Transport.WebSocket
  • WebSocketLoopVixen.Net.Transport.WebSocket.Tests
  • WebSocketTransportVixen.Net.Transport.WebSocket