TsgcWebSocketHTTPServerProperties › Active

Active Property

Starts or stops the HTTP/WebSocket server, opening the listening sockets on the configured bindings.

Syntax

public bool Active { get; set; }

Default Value

False

Remarks

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.

Example


oServer = new TsgcWebSocketHTTPServer();
oServer.Port = 80;
oServer.Active = true;

Back to Properties