there is not need to call CONNECTION_PREFACE 2 times. just call it one time and use the returned value for the checks and increase of indexes. The JIT may be smart enough to do this kind of stuff by it's now but I would not depend on this...