/// <exception cref="Db4objects.Db4o.Ext.InvalidPasswordException"></exception> private void LoginToServer(Socket4Adapter iSocket) { UnicodeStringIO stringWriter = new UnicodeStringIO(); int length = stringWriter.Length(_userName) + stringWriter.Length(_password); MsgD message = Msg.Login.GetWriterForLength(SystemTransaction(), length); message.WriteString(_userName); message.WriteString(_password); message.Write(iSocket); Msg msg = ReadLoginMessage(iSocket); ByteArrayBuffer payLoad = msg.PayLoad(); BlockSize(payLoad.ReadInt()); int doEncrypt = payLoad.ReadInt(); if (doEncrypt == 0) { _handlers.OldEncryptionOff(); } if (payLoad.RemainingByteCount() > 0) { _serverSideID = payLoad.ReadInt(); } }