TsgcWebSocketServer › Methods › ReStart
Stops and then restarts the server from a secondary thread, useful after changing bindings or ports at runtime.
procedure ReStart;
ReStart chains a Stop followed by a Start inside an internal worker thread, so the caller is not blocked while connections are closed and bindings reopened. It is the recommended way to apply configuration changes that require the server to re-bind its sockets at runtime. The OnShutdown event fires once the old listener stops, and OnStartup fires again once the new listener is accepting connections. When changing Port or Bindings, call Bindings.Clear after stopping so the old bindings are not reused.
oServer.Port := 8080;
oServer.ReStart();