On 01/16/2014 09:01 AM, Patrik Flykt wrote: > > Hi, > > On Wed, 2014-01-15 at 16:45 +0100, Daniel Wagner wrote: >> On 01/15/2014 04:11 PM, Patrik Flykt wrote: >>> On Wed, 2014-01-15 at 15:55 +0100, Daniel Wagner wrote: >>>> IIRC we discussed the benefits of having a __connman_auto_disconnect() >>>> and we agreed that it is not brilliant idea. Instead it would be >>>> better when the auto connect part handles this. >>> >>> I can't remember anymore what we discussed (f2f?), but it would be >>> better to disconnect the service when it is known that a session >>> connected it and the last session using it has closed. >> >> http://permalink.gmane.org/gmane.comp.handhelds.moblin.connman/15856 >> >> My understanding was that you didn't like to have an explicit call to >> disconnect. Instead it should be part of auto connect which makes really >> sense. In this series, auto connect tries first to connect something >> (and my plan for later would also like switch from one service to >> another if needed) and in the second step to disconnect unused services. > > In the above link I didn't like an explicit function for disconnecting > that is called at some undefined time. I have been trying to say that > disconnects should happen immediately after the last session is not > interested in the service anymore and that the service was connected > only because a session caused it to be connected in the first place.
That is taken care as it is currently. The disconnect logic is just not yet merged into auto_connect_service() instead it runs right after it. Any change on the configuration will trigger auto_connect_service() to run. > I still don't want a *_disconnect(void) function that can be called > anytime "later" and leaving the session requested service idling for an > extended period of time. I have tested this and as soon a session dies, disconnects or updates its configuration the service is disconnected. It is really working nicely. Also some more complex setups work correctly. E.g. when we have two session the first one does a Session.Connect() both session go online (with matching configuration) and when the first session dies or does a Session.Disconnect() the selected service goes offline and consequently the second (free-ride) session goes offline as well. All this happens immediately, no hanging around etc. cheers, daniel _______________________________________________ connman mailing list [email protected] https://lists.connman.net/mailman/listinfo/connman
