Example #1
0
        //("$t_protocol->has_request() && $t_protocol->is_asyn_req_rsp_protocol()")
        public unsafe static Task <t_protocol_responseReader> t_method_name_3(this Trinity.Storage.IMessagePassingEndpoint storage, t_protocol_requestWriter msg)
        {
            byte **bufferPtrs = stackalloc byte *[2];
            int *  size       = stackalloc int[2];
            byte * bufferPtr  = stackalloc byte[TrinityProtocol.MsgHeader + TrinityProtocol.AsyncWithRspAdditionalHeaderLength];

            bufferPtrs[0] = bufferPtr;
            bufferPtrs[1] = msg.buffer + TrinityProtocol.MsgHeader;
            size[0]       = TrinityProtocol.MsgHeader + TrinityProtocol.AsyncWithRspAdditionalHeaderLength;
            size[1]       = msg.Length;

            try
            {
                int token       = Interlocked.Increment(ref t_comm_nameBase.s_t_protocol_name_token_counter);
                var task_source = new TaskCompletionSource <t_protocol_responseReader>();
                t_comm_nameBase.s_t_protocol_name_token_sources[token] = task_source;
                *(int *)(bufferPtr) = TrinityProtocol.TrinityMsgHeader + msg.Length + TrinityProtocol.AsyncWithRspAdditionalHeaderLength;
                *(bufferPtr + TrinityProtocol.MsgTypeOffset)                  = (byte)__meta.META_OUTPUT("get_comm_protocol_trinitymessagetype($t_protocol)");;
                *(ushort *)(bufferPtr + TrinityProtocol.MsgIdOffset)          = (ushort)global::t_Namespace.TSL.t_base_class_name.t_comm_name.t_protocol_typeMessageType.t_protocol_name;
                *(int *)(bufferPtr + TrinityProtocol.MsgHeader)               = token;
                *(int *)(bufferPtr + TrinityProtocol.MsgHeader + sizeof(int)) = Global.CloudStorage.MyInstanceId;
                t_send_message(bufferPtrs, size, 2);
                return(task_source.Task);
            }
            finally { }
        }
            public unsafe static void Ping(this Trinity.Storage.IMessagePassingEndpoint storage)
            {
                byte *bufferPtr = stackalloc byte[TrinityProtocol.MsgHeader];

                *(int *)(bufferPtr) = TrinityProtocol.TrinityMsgHeader;
                *(TrinityMessageType *)(bufferPtr + TrinityProtocol.MsgTypeOffset) = TrinityMessageType.SYNC;
                *(ushort *)(bufferPtr + TrinityProtocol.MsgIdOffset) = (ushort)global::InKnowWorks.TripleStoreMemoryCloud.Protocols.TSL.TSL.CommunicationModule.TripleStoreMemoryCloudServiceModule.SynReqMessageType.Ping;
                storage.SendMessage <TripleStoreMemoryCloudServiceModuleBase>(bufferPtr, TrinityProtocol.MsgHeader);
            }
Example #3
0
        public unsafe static void t_method_name(this Trinity.Storage.IMessagePassingEndpoint storage, t_protocol_requestWriter msg)
        {
            byte *bufferPtr = msg.buffer;

            *(int *)(bufferPtr) = msg.Length + TrinityProtocol.TrinityMsgHeader;
            *(TrinityMessageType *)(bufferPtr + TrinityProtocol.MsgTypeOffset) = __meta.META_OUTPUT("get_comm_protocol_trinitymessagetype($t_protocol)");;
            *(ushort *)(bufferPtr + TrinityProtocol.MsgIdOffset) = (ushort)global::t_Namespace.TSL.t_base_class_name.t_comm_name.t_protocol_typeMessageType.t_protocol_name;
            t_send_message(bufferPtr, msg.Length + TrinityProtocol.MsgHeader);
        }
Example #4
0
        public unsafe static void t_method_name(this Trinity.Storage.IMessagePassingEndpoint storage)
        {
            byte *bufferPtr = stackalloc byte[TrinityProtocol.MsgHeader];

            *(int *)(bufferPtr) = TrinityProtocol.TrinityMsgHeader;
            *(bufferPtr + TrinityProtocol.MsgTypeOffset)         = (byte)__meta.META_OUTPUT("get_comm_protocol_trinitymessagetype($t_protocol)");;
            *(ushort *)(bufferPtr + TrinityProtocol.MsgIdOffset) = (ushort)global::t_Namespace.TSL.t_base_class_name.t_comm_name.t_protocol_typeMessageType.t_protocol_name;
            t_send_message(bufferPtr, TrinityProtocol.MsgHeader);
        }
            public unsafe static StoreTripleResponseReader StoreTriple(this Trinity.Storage.IMessagePassingEndpoint storage, StoreTripleRequestWriter msg)
            {
                byte *bufferPtr = msg.buffer;

                *(int *)(bufferPtr) = msg.Length + TrinityProtocol.TrinityMsgHeader;
                *(TrinityMessageType *)(bufferPtr + TrinityProtocol.MsgTypeOffset) = TrinityMessageType.SYNC_WITH_RSP;
                *(ushort *)(bufferPtr + TrinityProtocol.MsgIdOffset) = (ushort)global::InKnowWorks.TripleStoreMemoryCloud.Protocols.TSL.TSL.CommunicationModule.TripleStoreMemoryCloudServiceModule.SynReqRspMessageType.StoreTriple;
                TrinityResponse response;

                storage.SendMessage <TripleStoreMemoryCloudServiceModuleBase>(bufferPtr, msg.Length + TrinityProtocol.MsgHeader, out response);
                return(new StoreTripleResponseReader(response.Buffer, response.Offset));
            }
Example #6
0
        public unsafe static t_protocol_responseReader t_method_name_2(this Trinity.Storage.IMessagePassingEndpoint storage)
        {
            byte *bufferPtr = stackalloc byte[TrinityProtocol.MsgHeader];

            *(int *)(bufferPtr) = TrinityProtocol.TrinityMsgHeader;
            *(TrinityMessageType *)(bufferPtr + TrinityProtocol.MsgTypeOffset) = __meta.META_OUTPUT("get_comm_protocol_trinitymessagetype($t_protocol)");;
            *(ushort *)(bufferPtr + TrinityProtocol.MsgIdOffset) = (ushort)global::t_Namespace.TSL.t_base_class_name.t_comm_name.t_protocol_typeMessageType.t_protocol_name;
            TrinityResponse response;

            t_send_message(bufferPtr, TrinityProtocol.MsgHeader, out response);
            return(new t_protocol_responseReader(response.Buffer, response.Offset));
        }
Example #7
0
        public unsafe static t_protocol_responseReader t_method_name_2(this Trinity.Storage.IMessagePassingEndpoint storage, t_protocol_requestWriter msg)
        {
            byte *bufferPtr = msg.buffer;

            try
            {
                *(int *)(bufferPtr) = msg.Length + TrinityProtocol.TrinityMsgHeader;
                *(bufferPtr + TrinityProtocol.MsgTypeOffset)         = (byte)__meta.META_OUTPUT("get_comm_protocol_trinitymessagetype($t_protocol)");;
                *(ushort *)(bufferPtr + TrinityProtocol.MsgIdOffset) = (ushort)global::t_Namespace.TSL.t_base_class_name.t_comm_name.t_protocol_typeMessageType.t_protocol_name;
                TrinityResponse response;
                t_send_message(bufferPtr, msg.Length + TrinityProtocol.MsgHeader, out response);
                return(new t_protocol_responseReader(response.Buffer, response.Offset));
            }
            finally { }
        }
            public unsafe static Task <ErrorCodeResponseReader> PostTriplesToServer(this Trinity.Storage.IMessagePassingEndpoint storage, TripleStreamWriter msg)
            {
                byte **bufferPtrs = stackalloc byte *[2];
                int *  size       = stackalloc int[2];
                byte * bufferPtr  = stackalloc byte[TrinityProtocol.MsgHeader + TrinityProtocol.AsyncWithRspAdditionalHeaderLength];

                bufferPtrs[0] = bufferPtr;
                bufferPtrs[1] = msg.buffer + TrinityProtocol.MsgHeader;
                size[0]       = TrinityProtocol.MsgHeader + TrinityProtocol.AsyncWithRspAdditionalHeaderLength;
                size[1]       = msg.Length;
                int token       = Interlocked.Increment(ref TripleServerBase.s_PostTriplesToServer_token_counter);
                var task_source = new TaskCompletionSource <ErrorCodeResponseReader>();

                TripleServerBase.s_PostTriplesToServer_token_sources[token] = task_source;
                *(int *)(bufferPtr) = TrinityProtocol.TrinityMsgHeader + msg.Length + TrinityProtocol.AsyncWithRspAdditionalHeaderLength;
                *(TrinityMessageType *)(bufferPtr + TrinityProtocol.MsgTypeOffset) = TrinityMessageType.ASYNC_WITH_RSP;
                *(ushort *)(bufferPtr + TrinityProtocol.MsgIdOffset)          = (ushort)global::Trinity.Client.TestProtocols.TSL.CommunicationModule.TripleServer.AsynReqRspMessageType.PostTriplesToServer;
                *(int *)(bufferPtr + TrinityProtocol.MsgHeader)               = token;
                *(int *)(bufferPtr + TrinityProtocol.MsgHeader + sizeof(int)) = Global.CloudStorage.MyInstanceId;
                storage.SendMessage <TripleServerBase>(bufferPtrs, size, 2);
                return(task_source.Task);
            }