Thanks for your help. That means we can't totally rely on watchs because it may loss event if session expired, right?
在 2012年5月19日星期六,Camille Fournier <[email protected]> 写道: > I'm not sure what you mean in question #1. A session expired event > generally causes the client to become completely invalid, you could > wrap the client in your own logic to record what you were watching, > but I don't think you can get that out of the client after it's > expired. > > 2. You won't be able to see events that happened when the session was > expired. The server has closed your connection and won't know to send > you events unless you have a valid session with a valid watch. > > 3. Reconnect won't work on expired sessions, you need to create an > entirely new session. Reconnect works when you get disconnected but > not expired. > > Hope that helps > On Fri, May 18, 2012 at 12:18 PM, 李赫元 <[email protected]> wrote: >> Hi, All >> >> I'm dealing with the case of "session expired" event. Please help me >> with the following question. >> >> 1. After receive "session expired" event, how to recover the watch >> that are setting before expired gracefully? >> >> >> 2.Currently, I record the watch setting and call the api to set it >> again after I got "expired event". It will callback for event after >> connection was success again. But what about the event happend between >> I success reinit the session to zk server. Currently, it got lost. Is >> there any way that I can got these events ? >> >> >> 3.I try to use reconnect, in zookeeper_init, but does't work. My guess >> is reconnect is only work for connection that are in state connect >> (Not valid after session timeout), is it right? >> >> >> Thanks for your help ! >
