TsgcWSPServer_FilesEvents › OnConnect

OnConnect Event

Fired when a client successfully connects to the server.

Syntax

property OnConnect: TsgcWSConnectEvent;
// TsgcWSConnectEvent = procedure(Connection: TsgcWSConnection) of object

Default Value

Remarks

Use this event to initialize per-connection state once a WebSocket client has completed the handshake on the hosting server. Connection.Guid uniquely identifies the client and is the value accepted by SendFile and WriteData.

Example

procedure TForm1.oFilesConnect(Connection: TsgcWSConnection);
begin
  Memo1.Lines.Add('connected: ' + Connection.Guid);
end;

Back to Events