TsgcWebSocketServerMethoden › Ping

Ping Methode

Verzendt een WebSocket-pingframe naar elke verbonden client.

Syntaxis

procedure Ping(const aText: string = '');

Parameters

NaamTypeBeschrijving
aTextconst stringOptionele payload in het ping-frame; geef een lege tekenreeks door om een ping zonder payload te verzenden.

Opmerkingen

Ping iterates the actief verbinding list and sends a WebSocket ping frame to elk client, returning zodra de frames are handed to the underlying sockets. It is a convenient way to keep idle connections alive or to probe liveness manually naast the automatisch HeartBeat mechanism. When the HeartBeat time-out is geconfigureerd, de server closes elk verbinding that does not answer within the window; without a time-out the call is verzend-en-vergeet and elk pong replies are delivered asynchroon through the standaard verbinding events. Exceptions raised while writing are routed to OnException.

Voorbeeld


oServer.Ping('keepalive');

Terug naar methoden