TsgcWebSocketServerProprietà › LastError

LastError Proprietà

Stringa di sola lettura con la descrizione dell'errore più recente generato dal server.

Sintassi

property LastError: string read FLastError;

Valore predefinito

'' (stringa vuota)

Note

Ogni volta che il componente segnala un errore tramite OnError o OnException, il testo dell'errore viene memorizzato anche in LastError, quindi il motivo dell'ultimo errore (ad esempio, un listener che non è stato possibile avviare perché la porta è già in uso) può essere esaminato in seguito senza gestire tali eventi. Una stringa vuota significa che non è stato registrato alcun errore. La stessa proprietà è disponibile nei componenti client.

Esempio


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

Torna alle Proprietà