Exemple #1
0
        public unsafe static ResultReader QueryToMyProxy(this Trinity.Storage.MemoryCloud storage, int proxyId, NameRequestWriter msg)
        {
            byte *bufferPtr = (byte *)msg.handle.AddrOfPinnedObject().ToPointer();

            *(int *)(bufferPtr) = msg.Length + TrinityProtocol.ProtocolHeaderLength;
            *(bufferPtr + TrinityProtocol.MsgTypeOffset) = (byte)TrinityMessageType.SYNC_WITH_RSP;
            *(bufferPtr + TrinityProtocol.MsgIdOffset)   = (byte)Trinity.TSL.TrinityProxy.MyProxy.SynReqRspMessageType.Query;
            TrinityMessage response;

            Global.GetProxy(proxyId).SendMessage(
                msg.buffer,
                0,
                msg.Length + TrinityProtocol.MsgHeader, out response);
            return(new ResultReader(response.Buffer, TrinityMessage.Offset));
        }
Exemple #2
0
        public unsafe static void SearchToMySlave(this Trinity.Storage.MemoryCloud storage, int slaveId, NameRequestWriter msg)
        {
            byte *bufferPtr = (byte *)msg.handle.AddrOfPinnedObject().ToPointer();

            *(int *)(bufferPtr) = msg.Length + TrinityProtocol.ProtocolHeaderLength;
            *(bufferPtr + TrinityProtocol.MsgTypeOffset) = (byte)TrinityMessageType.ASYNC;
            *(bufferPtr + TrinityProtocol.MsgIdOffset)   = (byte)Trinity.TSL.TrinitySlave.MySlave.AsynReqMessageType.Search;
            Global.CloudStorage.SendMessage(
                slaveId,
                msg.buffer,
                0,
                msg.Length + TrinityProtocol.AsyncRequestWithoutResponseHeaderLength);
        }