void readConnectResult() throws IOException {
ByteBufferInputStream bbis = new ByteBufferInputStream(
incomingBuffer);
BinaryInputArchive bbia = BinaryInputArchive.getArchive(bbis);
ConnectResponse conRsp = new ConnectResponse();
conRsp.deserialize(bbia, "connect");
int sessionTimeout = conRsp.getTimeOut();
if (sessionTimeout <= 0) {
zooKeeper.state = States.CLOSED;
eventThread.queueEvent(new WatchedEvent(
Watcher.Event.EventType.None,
Watcher.Event.KeeperState.Expired, null));
throw new IOException("Session Expired");
}
readTimeout = sessionTimeout * 2 / 3;
connectTimeout = sessionTimeout / serverAddrs.size();
sessionId = conRsp.getSessionId();
sessionPasswd = conRsp.getPasswd();
eventThread.queueEvent(new WatchedEvent(Watcher.Event.EventType.None,
Watcher.Event.KeeperState.SyncConnected, null));
if (!disableAutoWatchReset) {
SetWatches sw = new SetWatches(lastZxid,
zooKeeper.getDataWatches(),