private unsafe void _QueryHandler(SynReqRspArgs args) { fixed(byte *p = &args.Buffer[args.Offset]) { var responseBuff = new ResultWriter(); QueryHandler(new NameRequestReader(p), responseBuff); *(int *)(responseBuff.CellPtr - TrinityProtocol.MsgHeader) = responseBuff.Length + TrinityProtocol.TrinityMsgHeader; args.Response = new TrinityMessage(responseBuff.buffer, responseBuff.Length + TrinityProtocol.MsgHeader); } }
public abstract void QueryHandler(NameRequestReader request, ResultWriter response);
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); }