TsgcWebSocketServer › Properties › Active
Starts or stops the server, opening the listening sockets on the configured bindings.
property Active: Boolean read GetActive write SetActive default False;
False
Set Active to True to make the server start listening on the configured Port (and any additional Bindings); setting it back to False stops the server and closes every active connection. The switch is executed in the calling thread, so the method blocks until the listener is fully up or down — use Start/Stop if you prefer a background thread. After stopping, call Bindings.Clear() before restarting on a different port to discard the previous handles.
oServer := TsgcWebSocketServer.Create(nil);
oServer.Port := 80;
oServer.Active := true;