mono / dbus-sharp

DBus Sharp
http://mono.github.com/dbus-sharp
MIT License
77 stars 59 forks source link

Connection.IsConnected is not set to false when connection to dbus is lost #29

Open steffen-kiess opened 10 years ago

steffen-kiess commented 10 years ago

Currently, when the connection to dbus is lost (e.g. because the dbus sever is killed), Connection.Iterate() will return without setting Connection.IsConnected to false. A program using dbus-sharp then will call DBus.Iterate() again, causing 100% CPU load without doing anything.

The problem is that Transport.ReadMessageReal() returns null when the read from the socket return 0, but Connection.Iterate()/Connection.HandleMessage() do not take any action then msg is null (they probably should terminate the connection).