TsgcWSPClient_sgc › Methods › GetLastOffset
Returns the last message offset the client has seen on a channel.
function GetLastOffset(const aChannel: String): Int64;
| Name | Type | Description |
|---|---|---|
aChannel | const String | Name of the channel whose tracked offset is returned. |
The last offset received on the channel. Returns 0 when the client has not yet received any message on the channel (or when Message History is not enabled on the server).
The client keeps a per-channel cursor with the offset of the last message it received while Message History is enabled on the server. This cursor is what a plain Subscribe sends on reconnection so the server replays only the messages the client missed. Use GetLastOffset to inspect that cursor, for example to persist it across application restarts or to drive an explicit Subscribe(aChannel, aSinceOffset) replay.
In .NET the matching SetLastOffset and ClearOffsets methods let you restore or reset the tracked cursors.
LastOffset := oProtocol.GetLastOffset('news');