DCS World Typescript
    Preparing search index...

    A class representing a web application, extending the functionality of HttpServer.

    Hierarchy (View Summary)

    Index
    errorMiddleware: AppErrorMiddleware
    errors: { error: Error; [key: string]: any }[] = []

    The request handler to be used when serving requests

    logger: Logger
    requestHandlers: { method?: string; middleware: AppMiddleware; route?: string }[]
    server: TCP

    The underlying TCP server.

    • Legacy entry point, kept for compatibility: it runs one pump.

      Unlike earlier versions it neither handles exactly one client nor finishes a request within the call: a call may accept several clients and advance several connections, and a request may take several calls to be read and answered. Keep calling it repeatedly, as before.

      Returns void

      Use pump.

    • Closes the listening socket and every open connection and releases their buffers. Safe to call more than once; later calls, and later pumps, do nothing.

      Returns void

    • The number of open connections. (A method rather than a getter: accessors would slow every property access on the server and its subclasses in the generated Lua.)

      Returns number

    post

    • Does a bounded amount of work and returns: accepts up to maxAcceptsPerPump new connections (while fewer than maxConnections are open), then visits open connections round-robin within the per-pump budgets. Call it repeatedly, for example from a timer callback; it never waits for a socket.

      Returns PumpStats

      What this pump did. Cheap to ignore; useful for instrumentation.