public sealed class ContentServerHostPuts a ContentServer on a socket.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Deliberately the thinnest thing that can be: accept, hand the path and the range header to Serve, write back what it says. Every decision — what exists, what a range means, what is inside the root — is made by the class above, which is testable without binding a port. Doc 12 § testing rules out real network in tests, and the way to obey that without leaving the interesting half unchecked is to keep the interesting half out of here.
HttpListener rather than Kestrel: this is a development tool that should not pull ASP.NET into the build graph, and everything it needs — ranges, statuses, keep-alive — the BCL listener already does.
Fields and properties (2)
public string PrefixWhere it is listening.
public Action<string>? LogTold about each request as it is answered, for a developer watching a console.
Methods (3)
public ContentServerHost(ContentServer server, int port, string host = "localhost")Sets up a host.
public Task RunAsync(CancellationToken cancellationToken = default(CancellationToken))Listens until cancelled.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Used by (2)
- ProgramAddressablesRemote
- VixenCommandVixen.Cli