Hi Matt, Am Dienstag 03 April 2012, um 17:11:56 schrieb Matthew Barnes: > On Tue, 2012-04-03 at 10:40 -0400, Matthew Barnes wrote: > > g_network_monitor_can_reach() takes a GSocketConnectable -- which is > > just an interface that's implemented by several concrete classes like > > GNetworkAddress (based on host name and port number) and GNetworkService > > (based on SRV records), so I assume service will be taken into account > > when possible in determining the boolean result that would feed into > > EBackend's "online" state. > > Seems I'm assuming too much. > > Dan Winship advises me that g_network_monitor_can_reach() merely checks > if there's a route to the host, but doesn't actually connect. > > Would it make sense to split the "online" state into two flags, perhaps > "host-reachable" and "service-available"? The latter would reflect the > result of actually trying to connect to the service to see if something > answers, obviously only attempted if "host-reachable" is set. > > These could both be class methods in EBackend so backends can tailor > them as needed. For example, an HTTP server may well respond alright, > but with a "501 Service Unavailable" which should interpreted as FALSE. > > Would this distinction be useful to backends? I can only speak for evo-kolab, but that much I will do. Seems to me that opening a connection in order to find out whether I could open a connection is more than evo-kolab would need. Unless the "service-available" check would be really cheap, it seems to me that "host-reachable" would suffice. Once I actually try to connect and fail, I know that I cannot connect. Nothing lost. ;-) (What's more, if "service-available" was TRUE half an hour ago, when the check was made, that does not automatically mean that it is still TRUE when I want to actually *use* the connection half an hour later - so, not sure whether a "service-available" check would help much). Kind regards, Christian -- kernel concepts GmbH Tel: +49-271-771091-14 Sieghuetter Hauptweg 48 D-57072 Siegen http://www.kernelconcepts.de/
Attachment:
signature.asc
Description: This is a digitally signed message part.