TsgcWebSocketServerProperties › LastError

LastError Property

Read-only string with the description of the most recent error raised by the server.

Syntax

property LastError: string read FLastError;

Default Value

'' (empty string)

Remarks

Whenever the component reports a failure through OnError or OnException, the error text is also stored in LastError, so the reason of the last failure (for example, a listener that could not be started because the port is already in use) can be inspected afterwards without handling those events. An empty string means no error has been recorded. The same property is available on the client components.

Example


oServer := TsgcWebSocketServer.Create(nil);
oServer.Port := 80;
oServer.Active := true;
if not oServer.Active then
  ShowMessage('Server failed to start: ' + oServer.LastError);

Back to Properties