Vixen
02b45cc4
csharp
public sealed class InjectingTransport

A transport whose wire is whatever the fuzzer hands it.

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

Remarks

The bytes go in where a socket would put them, not where a test would. A session only ever sees inbound data through Poll, so injecting through Poll is what makes the fuzzed frame the real frame: the handshake table, the ping bookkeeping, the reconnect window and the message handler are all live, and a defect that needs two of them to be in a particular state is reachable. Calling OnData on the session directly would be a shorter path to a smaller claim.

What it sends goes nowhere and is counted. The counts are part of the behaviour signature — "this input made the server answer" is a different outcome from "this input was dropped without comment", and telling them apart is what stops the corpus collapsing onto inputs that are all refused at the first byte.

Fields and properties (5)

  • public TransportCapabilities Capabilities
  • public TransportState ServerState

    Whether the server half is listening.

  • public TransportState ClientState

    Whether the client half is connected.

  • public long Sent

    How many payloads the peer above has tried to send.

  • public long Disconnects

    How many connections it has closed.

Methods (12)

  • public void StartServer()

    Starts listening. Where — a port, an address, a relay — was fixed when the transport was constructed, which is what keeps this interface free of anything socket-shaped.

  • public void StopServer()

    Stops listening and disconnects everyone, reporting ServerStopped to both sides. Does nothing if the server half is already stopped.

  • public void StartClient()

    Begins connecting. Completion is reported to OnConnected on a later Poll, or refusal to OnDisconnected — never inline, so the caller has one code path for "connected in a microsecond over loopback" and "connected in 90 ms over the Atlantic".

  • public void StopClient()

    Disconnects the client half, reporting Requested to this side and RemoteRequested to the server. Does nothing if the client half is already stopped.

  • public void Disconnect(ConnectionId connection)

    Closes one connection from the server side, reporting Requested here and Kicked there. Does nothing if the connection is not one of ours.

  • public void SendToClient(ConnectionId connection, ReadOnlySpan<byte> payload, Channel channel)

    Sends to one connected client. Does nothing if the connection is not ours.

  • public void SendToServer(ReadOnlySpan<byte> payload, Channel channel)

    Sends to the server. Does nothing if the client half is not connected.

  • public void Connect(ConnectionId connection)

    Queues a connection arriving at the server half.

  • public void Drop(TransportRole role, ConnectionId connection)

    Queues a connection going away.

  • public void Deliver(TransportRole role, ConnectionId connection, Channel channel, byte[] payload, int length)

    Queues bytes arriving.

  • public void Poll(TimeSpan elapsed, ITransportEvents events)

    Advances the transport by and reports everything that has happened since the last call, in the order it happened, to .

  • public void Dispose()

    Forgets anything queued.

Used by (2)

  • HandshakeTargetVixen.Net.Fuzz
  • SessionClientTargetVixen.Net.Fuzz