LiveMap API
Loading...
Searching...
No Matches
livemap.httpd Namespace Reference

Functions

partial class WebServer (LiveMap server)

Function Documentation

◆ WebServer()

partial class livemap.httpd.WebServer ( LiveMap server)

Loads a file from disk and creates a CachedFile with ETag calculation. This is a shared helper to avoid code duplication for file loading and ETag calculation.

Clears the file cache. Used for testing and disposal. This method ensures atomic clearing of both the dictionary and size counter.

Returns a read-only MemoryStream wrapping the cached byte array. Each call creates a new MemoryStream instance, which is safe for concurrent reads since the underlying byte array is immutable from this resource's perspective. The writable parameter is set to false to prevent accidental modification. Note: Each request creates a new CachedResource instance, so concurrent requests operate on separate instances (though they may reference the same cached byte array).

Writes the cached data to the target stream using the specified buffer size. The data is written in chunks to respect the buffer size parameter and avoid large single writes that could block the thread pool.