Use Socket.create_socket_source() as it works for both TCP and UDP
sockets, but also does not use GDatagramBased interface, thus should
allow building on systems with older GLib versions.
Replace named constructor Device.from_cache() with static method
Device.new_from_cache() to catch errors when loading from cache and
return null in such case.
Calling Socket.create_source() will generate a C call to
g_socket_datagram_based_create_source(), and that returns null for TCP
sockets. Use a helper Socket.create_socket_source() method to workaround
this problem..
Due to gio-2.0 VAPI changes Socket.create_source() does not return a
SocketSource anymore, but a standard GLib.Source instead. Make sure that
we cast to SocketSource.
Keep track of known device and dump their info to cache. This should
speed up reconnect after restarting mconnect. The rationale is that the
devices are likely to be connected to to the local network and use
DHCP and as such will most probably get the same address the next time
they appear. Hence, it should be ok to attemp connection the last know
IP address. If that fails, the discovery process will still take place.
Currently notifications shown so far are not tracked, thus often it
happens that multiple notifications regarding the same topic appear,
where only one should be shown. The change adds tracking of
notifications being shown within the Notification class.
Notifications cleared by user will be re-shown if device pushes them
again.
Whenever a mobile device wakes up, it will send an identity packet from
the same IP, using different 'tcpPort' in the message. This should
prevent device from being closed and reconnected to too frequently.