![]() |
Indy TidIPWatch - onstatuschange ?
Hallo,
ich möchte gerne mit der Indy Komponente TidIPWatch meine lokale IP bestimmen. Ich mache das im Event onstatuschange und das funktioniert genau ein mal. Wenn sich meine IP ändert (ich habe mal testweise meine statische IP verändert) wird dieser Event aber nicht durchlaufen. Liegt das evtl. an der Indykomponente oder ist das falsche Event? OnStatus wird allerdings auch nicht abgefeuert. Ich nutze XE6 mit Indy 10.6.0.5122. Gruß Mirko |
AW: Indy TidIPWatch - onstatuschange ?
Zitat:
![]() Zitat:
Delphi-Quellcode:
Ein IP-Adressenwechsel wird anscheinend nicht als Kriterium für das Event verwendet.
if ((WasOnline) and (not FIsOnline)) or ((not WasOnline) and (FIsOnline)) then
begin if (not IsDesignTime) and Assigned(FOnStatusChanged) then begin FOnStatusChanged(Self); end; end; |
AW: Indy TidIPWatch - onstatuschange ?
Ok verstehe... so wie das aussieht ist der Wechsel von online zu offline das und umgekehrt das Kriterium.
Dann ist wirklich die Frage ob es die richtige Komponente ist. Vielleicht besser AddrMon. Ich probiere das mal. Danke für Deine Hilfe ! Viele Grüße Mirko |
AW: Indy TidIPWatch - onstatuschange ?
Zitat:
OnStatus und StatusChanged werden also nur am Anfang ausglöst und danach nicht mehr? Auch nicht, wenn du mal etwas länger wartest? PS: Noch bissl binäre Mathematik:
Delphi-Quellcode:
if (WasOnline and not FIsOnline) or (not WasOnline and FIsOnline) then
lässt sich arithmetisch in eine XOR umwandeln (exclusive or)
Delphi-Quellcode:
if WasOnline xor FIsOnline then
oder logisch in
Delphi-Quellcode:
if WasOnline <> FIsOnline then
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:39 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz