TsgcHTTPServer › 事件 › OnStartup
服务器启动并准备好接受连接后触发。
property OnStartup: TNotifyEvent;
// TNotifyEvent = procedure(Sender: TObject) of object
—
OnStartup 在主线程中触发,时机为 HTTP 监听器绑定完成且服务器开始接受新客户端连接之后。Sender 参数是 TsgcHTTPServer 实例。这是记录服务器状态或发布启动信息的便捷位置;繁重的初始化工作仍应在 Active 设为 True 之前完成,因为 OnStartup 在服务器已开始监听之后才运行。
procedure OnStartup(Sender: TObject);
begin
WriteLn('#http server started');
end;