public unsafe static void ReportToMyProxy(this Trinity.Storage.MemoryCloud storage, int proxyId, ResultWriter 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.TrinityProxy.MyProxy.AsynReqMessageType.Report; Global.GetProxy(proxyId).SendMessage( msg.buffer, 0, msg.Length + TrinityProtocol.AsyncRequestWithoutResponseHeaderLength); }
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)); }