public void ProcessAtServer() { IServerMessageDispatcher dispatcher = (IServerMessageDispatcher)MessageDispatcher (); int count = ReadInt(); Transaction ta = Transaction(); for (int i = 0; i < count; i++) { StatefulBuffer writer = _payLoad.ReadStatefulBuffer(); int messageId = writer.ReadInt(); Msg message = Msg.GetMessage(messageId); Msg clonedMessage = message.PublicClone(); clonedMessage.SetMessageDispatcher(MessageDispatcher()); clonedMessage.SetTransaction(ta); if (clonedMessage is MsgD) { MsgD msgd = (MsgD)clonedMessage; msgd.PayLoad(writer); if (msgd.PayLoad() != null) { msgd.PayLoad().IncrementOffset(Const4.IntLength); Transaction t = CheckParentTransaction(ta, msgd.PayLoad()); msgd.SetTransaction(t); dispatcher.ProcessMessage(msgd); } } else { dispatcher.ProcessMessage(clonedMessage); } } }
internal sealed override Msg ReadPayLoad(IMessageDispatcher messageDispatcher, Transaction a_trans, Socket4Adapter sock, ByteArrayBuffer reader) { int length = reader.ReadInt(); a_trans = CheckParentTransaction(a_trans, reader); Db4objects.Db4o.CS.Internal.Messages.MsgD command = (Db4objects.Db4o.CS.Internal.Messages.MsgD )PublicClone(); command.SetTransaction(a_trans); command.SetMessageDispatcher(messageDispatcher); command._payLoad = ReadMessageBuffer(a_trans, sock, length); return(command); }
public Db4objects.Db4o.CS.Internal.Messages.MsgD GetWriterForLength(Transaction trans , int length) { Db4objects.Db4o.CS.Internal.Messages.MsgD message = (Db4objects.Db4o.CS.Internal.Messages.MsgD )PublicClone(); message.SetTransaction(trans); message._payLoad = new StatefulBuffer(trans, length + Const4.MessageLength); message.WriteInt(_msgID); message.WriteInt(length); if (trans.ParentTransaction() == null) { message._payLoad.WriteByte(Const4.SystemTrans); } else { message._payLoad.WriteByte(Const4.UserTrans); } return(message); }