TsgcWebSocketServer | Server Startup Shutdown

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

 

OnStartup

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

 


void OnStartup(TObject *Sender)
{
  WriteLn("#server started");
}

 

OnShutdown

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

 


void OnShutdown(TObject *Sender)
{
  WriteLn("#server stopped");
}