예제 #1
0
        public override int MockIORead(IntPtr priv, byte[] buf, System.UInt32 count)
        {
            int nRead = base.MockIORead(priv, buf, count);

            if (nRead == count) // If read it all back
            {
                MockStoreUdbusTransport tempTransport = new MockStoreUdbusTransport();
                tempTransport.Stream = new System.IO.MemoryStream(buf);
                tempTransport.Stream.Seek(0, System.IO.SeekOrigin.Begin
                ManagedDbusIo dbus_io = new ManagedDbusIo();
                tempTransport.PopulateDbio(ref dbus_io);
                NMessageHandle.UdbusMessageHandle msg;
                UdbusMsgHandleFunctions.dbus_msg_recv(ref dbus_io, out msg);
                if (msg.HandleToStructure().reply_serial == this.lastSerial)
                {
                    UdbusMessageBuilder builder = new UdbusMessageBuilder();
                    // No can do since no accessors.
                    // Also, how would we then turn this back into binary format ??
                    builder.SetReplySerial(this.lastSerial);
                }

            } // Ends if read it all back

            return nRead;
        }
예제 #2
0
        public override int MockIORead(IntPtr priv, byte[] buf, System.UInt32 count)
        {
            int nRead = base.MockIORead(priv, buf, count);

            if (nRead == count) // If read it all back
            {
                MockStoreUdbusTransport tempTransport = new MockStoreUdbusTransport();
                tempTransport.Stream = new System.IO.MemoryStream(buf);
                tempTransport.Stream.Seek(0, System.IO.SeekOrigin.Begin
                ManagedDbusIo dbus_io = new ManagedDbusIo();
                tempTransport.PopulateDbio(ref dbus_io);
                NMessageHandle.UdbusMessageHandle msg;
                UdbusMsgHandleFunctions.dbus_msg_recv(ref dbus_io, out msg);
                if (msg.HandleToStructure().reply_serial == this.lastSerial)
                {
                    UdbusMessageBuilder builder = new UdbusMessageBuilder();
                    // No can do since no accessors.
                    // Also, how would we then turn this back into binary format ??
                    builder.SetReplySerial(this.lastSerial);
                }

            } // Ends if read it all back

            return nRead;
        }