TsgcTCPClient › Properties › LogFile
Slaat inkomend en uitgaand socketverkeer op in een bestand, handig voor het debuggen van het draadprotocol.
property LogFile: TsgcWSLogFile read GetLogFile write SetLogFile;
Enabled=False, Raw=False
Stel Enabled=True en FileName in op het volledige pad van het uitvoerlogboek. Elk blok dat wordt verzonden of ontvangen op de ruwe TCP-sessie wordt aan het bestand toegevoegd. Raw slaat de bytes op in hexadecimaal in plaats van platte tekst, wat handig is wanneer de payload binair is. Toegang tot het logbestand is niet thread-safe; deel hetzelfde bestand niet tussen meerdere threads.
oTCP := TsgcTCPClient.Create(nil);
oTCP.Host := 'www.esegece.com';
oTCP.Port := 2053;
oTCP.LogFile.FileName := 'C:\Logs\tcp.log';
oTCP.LogFile.Enabled := true;
oTCP.Active := true;