Hi Jeff, On 10/18/2011 08:52 AM, Jeff Zheng wrote: > Hi Daniel, > > On 10/17/2011 05:14 PM, Daniel Wagner wrote: >> Hi Jeff, >> >> On 10/17/2011 04:17 AM, Zheng, Jeff wrote: >>> Hi Wagi, >>> >>>> + The "offline" state indicates that no services for >>>> + a given session are online. "connecting" is indicating >>>> + that the session has called Service.Connect() >>>> + and if this call is successful the next state >>>> + indicated is "online". The application could >>>> + use the "connecting" state for starting to draw an >>>> + animation. >>>> + >>>> + If the Service.Connect() is not successful >>>> + the next state will be "offline". If the >>>> + application has started to draw an animation on >>>> + the "connecting" state it should stop drawing when >>>> + "offline". >>> I have two questions: >>> >>> 1. How to deal with service.State = 'ready', in which state >>> Service.Connect() returns successfully? >>> 2. State here is different than State in ' Session States and >>> Transitions', is it possible to use another name? >> As you already pointed out, the Session.State is not the same as >> Service.State. Essentially the session state is one logic layer above >> the service layer. If you look into the session code you see, that we >> already monitor all service states. Changing the setting from 'Online' >> to 'State' allows the session code to notify the application with some >> more state transitions then only 'Online'<-> 'Offline'. >> > I just try to understand this sentence in API description: > > + a given session are online. "connecting" is indicating > + that the session has called Service.Connect() > + and if this call is successful the next state > + indicated is "online". The application could > > When service.Connect() is successful, service.State can be either 'online' > or 'ready'. If the service.State='ready', can we say that session.State is > 'online' according to the API description?
Sorry about my poor writing skills. So let me try to rephrase this one. The application calls Session.Connect(). This call returns immediately and the application just waits. The connection algorithm inside session code can now start looking through the available services. If none service can be selected then ConnMan can defer this action. When a service is available ConnMan can then call Service.Connect(). When this happens the Session.State would change to "connecting". If the Service.Connect() call was successful: Service.State == Online (and only Online, not Ready) then we would change from Session.State "connecting" to "online". If something goes wrong Session.State would go back to "offline" > 'ready' state happens on company network and VPN environments and we > reported many bugs related with 'ready' and 'online'. Correct understanding > helps to avoid invalid bugs. I see. Yes, I also noted some of those problems with VPN, though I haven't started too look to closely. cheers, daniel _______________________________________________ connman mailing list [email protected] http://lists.connman.net/listinfo/connman
