Interface ServerHandle

All Known Implementing Classes:
ServerLifecycle

public interface ServerHandle
Public handle to the underlying HTTP transport. Returned by create(dev.relism.flash.extension.FlashConfiguration, dev.relism.flash.routing.AbstractRouter, dev.relism.flash.routing.AbstractWsRouter) so that FlashApp can start and stop the server without holding a direct reference to the transport's internal composition
  • Method Details

    • start

      void start()
      Starts the accept loop on a background platform thread. Returns immediately.
    • startAndBlock

      void startAndBlock()
      Starts the accept loop and blocks the calling thread until the server is stopped. Suitable for use in main() when no other work is needed after startup.
    • stop

      Gracefully stops the server, draining active connections.
    • port

      int port()
      Port of the first bound listener. Valid as soon as the handle exists — listeners are bound at construction, not at start() — so configuring with port 0 and reading the OS-assigned port back is a supported pattern.
    • ports

      List<Integer> ports()
      Ports of every bound listener, in configuration order.
    • create

      static ServerHandle create(FlashConfiguration config, AbstractRouter httpRouter, AbstractWsRouter wsRouter) throws IOException
      Throws:
      IOException