Skip to main content

WebServerThread

A class in Root.Township, Alta.WebServer.

Server: small HTTP server on its own thread that serves the save cache at /cache, output files at /output and the console at /console, with CORS open. ServerHandler starts it.

Constructors​

MemberWhat it is
WebServerThread(int port = 1761)Creates a WebServerThread from port.

Fields​

MemberWhat it is
const int PortDefault port, 1761.
2 private and internal fields
MemberWhat it is
private static Logger loggerClass logger.
private Thread threadThe thread the web server runs on.

Properties​

MemberWhat it is
string Url { get; }URL prefix the server listens on, all hosts on the given port.

Methods​

MemberWhat it is
void Dispose()Aborts the web server thread.
3 private and internal methods
MemberWhat it is
private WebServer Create()Builds the EmbedIO web server with the CORS, cache, output and console modules.
private async void Run()Thread entry: runs the web server. If it fails to start, the whole game server is stopped.
private void StateChanged(object sender, WebServerStateChangedEventArgs e)Logs web server state changes.

Used in​

Members of other types that take, return or hold a WebServerThread: