In the onheartbeat function I added
Code: Select all
# check if TV is online if (self.icmpConnection == None): self.icmpConnection = Domoticz.Connection(Name="LG_ICMP", Transport="ICMP/IP", Protocol="ICMP", Address=Parameters["Address"]) self.icmpConnection.Listen() else: self.icmpConnection.Send("PING")
When I ping it form the shell the plugin received the reply and it handles them correct.
When detroying the connection and start a new one (the part in the if statement) if a ICMP message is received does work, but every time a new connection has to be created.
So the requestion: How can I ping on an existing ICMP connection
Secondly I also noticed the file handle count is increasing, so a network connection is not closed/ destroyed correctly.
Are there a basic examples with a ICMP connection (basic is simple ping to single node)?