Class SteamHttpTransport
The HTTP seam every Steam client sends through: a send and a headers-first send, each wrapped once in the wire trace. The trace switch is asked on every request, so switching it on or off affects a client that was built before the switch, with nothing to rebuild.
Inherited Members
Namespace: Serenity.Steam.Infrastructure
Assembly: Serenity.Steam.Infrastructure.dll
Syntax
public sealed class SteamHttpTransport
Remarks
The one place the tracing decorator is wired. The real sends, the trace sink and the switch are constructor dependencies: a composition edge supplies SteamSharedHttpClient and the real sink, a test supplies fakes.
Constructors
SteamHttpTransport(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>>, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>>, ISteamWireTraceSink, Func<bool>, Action<string>)
Creates a transport over the given sends, traced into sink.
Declaration
public SteamHttpTransport(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> send, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> headersFirstSend, ISteamWireTraceSink sink, Func<bool> isTracingEnabled, Action<string> reportTraceFailure = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> | send | The real HTTP send. |
| Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> | headersFirstSend | The real send of downloads (answers on headers); a fake passes |
| ISteamWireTraceSink | sink | Where finished trace lines go. |
| Func<bool> | isTracingEnabled | Asked once per request; false makes the trace a pass-through. |
| Action<string> | reportTraceFailure | Told why a trace step failed. May be null. |
Properties
HeadersFirstSend
The traced send of downloads: answers when the headers arrive.
Declaration
public Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> HeadersFirstSend { get; }
Property Value
| Type | Description |
|---|---|
| Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> |
Send
The traced send: answers once the whole response has been read.
Declaration
public Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> Send { get; }
Property Value
| Type | Description |
|---|---|
| Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> |