March 2018
Beginner to intermediate
410 pages
10h 40m
English
When you lose a connection, or a friend, you might need to update your state or find new devices, if the connection that was lost was your sensor or actuator. Since this may happen for various reasons, we create a function for this event:
private void XmppClient_OnRosterItemRemoved(object Sender,
RosterItem Item)
{
Log.Informational("Roster item removed.", Item.BareJid);
this.FriendshipLost(Item);
}
When this happens, we restart the registration procedure, which in turn triggers the search procedure. This will allow the controller to eventually find new devices in its vicinity to which it can connect, to continue its operation:
private void FriendshipLost(RosterItem Item) { bool UpdateRegistration = false; if (string.Compare(Item.BareJid, ...Read now
Unlock full access