TsgcHTTPServer › Events › OnConnect
Fires every time a client connection is established.
property OnConnect: TsgcWSConnectEvent;
// TsgcWSConnectEvent = procedure(Connection: TsgcWSConnection) of object
—
OnConnect is raised after a client connection has been accepted and is ready to exchange HTTP requests. The Connection parameter identifies the new session and exposes its Guid, PeerIP, authentication state, and custom tag. Use OnTCPConnect to be notified the moment the TCP socket is accepted, before the HTTP layer takes over.
procedure OnConnect(Connection: TsgcWSConnection);
begin
Log('Client connected: ' + Connection.Guid + ' from ' + Connection.PeerIP);
end;