Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Class

HttpSocketHandler

class HttpSocketHandler

Module: System.Web.Http
Assembly: System.Web.dll
Source file: HttpClient.rvn

Inheritance: Object → HttpHandler → HttpSocketHandler

A bounded socket-backed HTTP/1.1 transport for predefined and custom method tokens; CONNECT tunnelling is unsupported. Each Send owns independent buffers and a connection.

Remarks

Development after Preview 9. Expected HTTP failures use the HttpError union, preserving DNS and socket causes. The socket transport admits HTTP/1.1 final statuses 200–599 using Content-Length, bounded chunked or close-delimited framing; HEAD/204/304 complete after headers, at most 32,768 header bytes, 100 fields and 1,048,576 body bytes. Chunk metadata is limited to 65,536 bytes; extensions and trailers are unsupported. HTTPS requires explicit SslClientAuthenticationOptions through HttpSocketHandler. No pooling, redirects or unknown-length uploads. Bounded informational responses are supported. ResponseHeadersRead transfers a one-shot body stream after final headers. Known-length stream uploads, buffered bodies and decoded incoming streams are limited to 1,048,576 bytes. HttpClient.Timeout covers the complete handler pipeline through the selected response completion point and defaults to 100 seconds. None disables the client countdown. DNS, connect and transfers retain independent five-second phase bounds, so transport failures can occur earlier. Direct HttpSocketHandler use has no client-wide countdown. Cancellation and expiry require scheduler progress and provider cleanup acknowledgement. See the Web feature guide for contracts and limits.

Constructors

2 items
HttpSocketHandler() Creates the default socket-backed handler.
HttpSocketHandler(sslOptions: SslClientAuthenticationOptions) Uses explicit TLS trust for HTTPS. The caller owns these immutable options.

Methods

6 items
Dispose() -> () Requests cancellation of this handler's pending exchanges, once. Overrides HttpHandler.Dispose · Overrides implementation of Disposable.Dispose
Equals(other: object?) -> bool Tests reference identity by default; an ordinary class may override equality. Inherited from Object.Equals
GetHashCode() -> int Returns a stable identity hash by default; an ordinary class may override it consistently with equality. Inherited from Object.GetHashCode
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
Send(request: HttpRequest, cancellationToken?: CancellationToken) -> Task<Result<HttpResponse, HttpError>> Uses one token across lookup, connect and transfers, closing before cancellation completes. Overrides HttpHandler.Send
ToString() -> string Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override. Inherited from Object.ToString