Presence Protocol

Channel-based user presence awareness for real-time applications. Know who is online, track join/leave events, and build collaborative experiences.

TsgcWSPClient_Presence / TsgcWSPServer_Presence

Channel-based presence: who is in a room, who joined, who left, group invitations, and channel-scoped publish/subscribe with optional Base64 payload encoding.

Component class

TsgcWSPClient_Presence

Protocol

Presence + channel pub/sub over a WebSocket carrier

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Professional / Enterprise

Drop the component, set a few properties, go

Set Presence.Name, Subscribe to a channel, Publish to broadcast, Invite to invite, GetMembers to list.

uses
  sgcWebSocket, sgcWebSocket_Server, sgcWebSocket_Protocol_Presence_Server,
  sgcWebSocket_Protocol_Presence_Client, sgcWebSocket_Protocol_Presence_Message;

// --- server side --------------------------------------------
ServerPresence := TsgcWSPServer_Presence.Create(nil);
ServerPresence.Server := WSServer;

// --- client side --------------------------------------------
ClientPresence := TsgcWSPClient_Presence.Create(nil);
ClientPresence.Client := WSClient;
ClientPresence.Presence.Name := 'alice';
WSClient.Active := True;

ClientPresence.Subscribe('room-42');
ClientPresence.Publish('hello room-42', 'room-42');
ClientPresence.GetMembers;

What's inside

7 published properties, 5 methods, 16 events — pulled from the component reference.

Connection

Published properties: Client, Broker, Guid.

Lifecycle

Events: OnConnect, OnDisconnect, OnError.

Advanced

Methods: WriteData.

Diagnostics

Published properties: Version.

Presence

Properties: Presence, Acknowledgment, EncodeBase64.

Subscriptions

Methods: Subscribe, UnSubscribe.

Specifications & references

Authoritative sources for the protocols this component implements.

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Demo Project — Demos\Protocols\Presence Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below.
Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only.
User Manual (PDF) Comprehensive manual covering every component in the library.

Ready to Add Presence Awareness?

Download the free trial and build collaborative real-time applications.