TsgcWebSocketServer | Server Startup Shutdown

Once you have set all required configurations of your server, there are 2 useful events to know when the server has started and when it has stopped.

 

OnStartup

This event is fired when the server has started and can process new connections.

 


procedure OnStartup(Sender: TObject);
begin
  WriteLn('#server started');
end;

 

OnShutdown

This event is fired after the server has stopped and no more connections are accepted.

 


procedure OnShutdown(Sender: TObject);
begin
  WriteLn('#server stopped');
end;