예제 #1
0
    void Start()
    {
        LinkedList <int> link = new LinkedList <int>();

        link.AddLast(100);
        link.AddLast(1000);
        link.Remove(100);



        directMessageCenter = new DirectMessageCenter();
        directMessageCenter.Regist(1000, new MessagetExecutorTest());

        //broadcastMessageCenter = new BroadcastMessageCenter();
        //broadcastMessageCenter.Regist(new BroadcastMessageExecutorTest());

        MessageTest msgTest1 = MessageTest.pool.New();

        msgTest1.messageID = 1000;
        msgTest1.Init(100, 200);

        MessageTest msgTest2 = MessageTest.pool.New();

        msgTest2.messageID = 1000;
        msgTest2.Init(300, 400);

        directMessageCenter.Send(msgTest1);
        //broadcastMessageCenter.Send(msgTest2);
    }
 public CombatMessageStrategy(int priority, string message, string imageSource, MessageTest test)
 {
     Priority    = priority;
     Message     = message;
     ImageSource = imageSource;
     mTest       = test;
 }
        private bool ValidateClass(RecordClassDispatcher value, object second, MessageTest helper, ProductInstanceExpression ord2, InitializerTest last3, ProductInstanceExpression t4)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            bool flag  = (PrintBroadcaster(helper, ord2, last3, t4) ?? LoginClass(baseProperty.m_PageError, (TaskListAnnotation)2)) && (ord2 == null || ord2._0003() || CallBroadcaster(last3, ord2));
            bool flag2 = RunClass((SparklineAxisMinMaxValues)2, helper, ord2, last3, t4);
            bool num   = flag || flag2;

            if (num)
            {
                value._0002();
                if (flag)
                {
                    PublishBroadcaster(value, ((ProcTest)helper)._0002(), second);
                }
                if (flag2)
                {
                    WriteBroadcaster(value, second.GetType());
                }
                value._0001("$values", injectcust: false);
            }
            if (((InitializerTest)helper)._0001() == null)
            {
                helper._0001(baseProperty.listenerError._0001(helper._0001() ?? typeof(object)));
            }
            return(num);
        }
예제 #4
0
        public void MergeOnlyOneClickEventSubscribed()
        {
            using (MessageTest messageTest = new MessageTest())
            {
                messageTest.m_nFirstOneClicked  = 0;
                messageTest.m_nSecondOneClicked = 0;

                MenuExtender menuExtender = new MenuExtender();
                menuExtender.MessageMediator = new Mediator();
                menuExtender.MessageMediator.AddColleague(messageTest);

                MainMenu first    = new MainMenu();
                MenuItem firstOne = new MenuItem("FirstOne");
                first.MenuItems.Add(new MenuItem(MenuMerge.MergeItems, 0, Shortcut.None, "First", null,
                                                 null, null, new MenuItem[] { firstOne }));
                menuExtender.SetCommandId(firstOne, "FirstOne");

                MainMenu second    = new MainMenu();
                MenuItem secondOne = new MenuItem("SecondOne");
                second.MenuItems.Add(new MenuItem(MenuMerge.MergeItems, 0, Shortcut.None, "Second", null,
                                                  null, null, new MenuItem[] { secondOne }));
                menuExtender.SetCommandId(secondOne, "SecondOne");

                MainMenu result = menuExtender.MergeMenus(first, second);
                result.MenuItems[0].MenuItems[0].PerformClick();
                result.MenuItems[0].MenuItems[1].PerformClick();

                Assert.AreEqual(1, messageTest.m_nFirstOneClicked);
                Assert.AreEqual(1, messageTest.m_nSecondOneClicked);
                // Clean up the mess now.
                menuExtender.MessageMediator.RemoveColleague(messageTest);
                menuExtender.MessageMediator.Dispose();
                menuExtender.MessageMediator = null;
            }
        }
            static void Main(string[] args)
            {
                Console.Write(" ================================================================================================\n");
                Console.Write("\n                                    TEST HARNESS WINDOW\n");
                Console.Write("\n ================================================================================================\n");
                Console.Write("\n  Files from Repository Receieved");
                Console.Write("\n ========================================\n");
                ServiceHost host = CreateServiceChannel("http://localhost:8082/StreamService");

                host.Open();
                Server Server = new Server();

                Console.Write("\n  press key for Testing! ");
                Console.ReadKey();
                host.Close();
                TestH.Creator newDomain = new TestH.Creator();   //Calling the create AppDomain function using object
                newDomain.CreateChildDomain();
                Message msg            = Server.makeMessage("Sahil Shah", Server.endPoint, Server.endPoint);
                string  remoteEndPoint = Comm <Server> .makeEndPoint("http://localhost", 8081);

                msg.to   = remoteEndPoint;
                msg.body = MessageTest.errorMessage();
                Server.comm.sndr.PostMessage(msg);
                Console.ReadKey();
                Console.Write("\n  press key to exit: ");
            }
예제 #6
0
        public static void Run()
        {
            CodeTimer.Initialize();
            var type = typeof(MessageTest <CmdTest>);
            var ctor = type.GetConstructors()[2];
            ObjectActivator <object> createdActivator = ActivatorHelper.GetActivator <object>(ctor);
            var    input  = new CmdTest();
            var    header = new MessageHeaderTest();
            object tmpObj = null;
            var    count  = 1000000;

            CodeTimer.Time("new instance", count, () =>
            {
                tmpObj = new MessageTest <CmdTest>(input, header);
            });

            CodeTimer.Time("exp tree", count, () =>
            {
                tmpObj = createdActivator(input, header);
            });

            CodeTimer.Time("Activator.CreateInstance", count, () =>
            {
                tmpObj = Activator.CreateInstance(type, input, header);
            });

            CodeTimer.Time("exp tree2", count, () =>
            {
                tmpObj = ActivatorHelper.CreateInstance(type, input, header);
            });
        }
        public void MessageTest(ClientSocket clientSocket, MessageBase messageBase)
        {
            MessageTest messageTest = (MessageTest)messageBase;

            Debug.Log(messageTest.ReqestContent);
            messageTest.ResponseContent = "服务器下发的数据";
            _serverSocket.Send(clientSocket, messageTest);
        }
예제 #8
0
    public void SendMessage()
    {
        MessageTest msg = new MessageTest();

        msg.text = "aaaaaaaaaa";

        NetworkServer.SendToAll(MyMsgType.test, msg);
    }
예제 #9
0
    public void SocketTest()
    {
        MessageTest msg = new MessageTest();

        msg.ReqestContent = "Dmk";

        _netController.RegisterProtoHandler(ProtocolEnum.MessageTest,
                                            (message) => { Debug.Log("测试回调:" + ((MessageTest)message).ResponseContent); });

        _netController.SendMessage(msg);
    }
예제 #10
0
    // Use this for initialization
    void Start()
    {
        LuaFunction func = luaState.GetFunction("Start");

        func.Call();
        func.Dispose();
        func = null;

        MessageTest msg = new MessageTest();

        msg.messageID = 1000;
        msg.field1    = 2000;
        messages.Enqueue(msg);
    }
        private void VerifyClass(RecordClassDispatcher value, IEnumerable second, MessageTest state, ProductInstanceExpression reference2, InitializerTest v3, ProductInstanceExpression init4)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            ManagerErrorFilter managerErrorFilter = second as ManagerErrorFilter;
            object             obj = (managerErrorFilter != null) ? managerErrorFilter._0001() : second;

            ManageBroadcaster(value, state, obj);
            wrapperProperty.Add(obj);
            bool flag = ValidateClass(value, obj, state, reference2, v3, init4);

            value._0003();
            int lengthpred = value._0002();
            int num        = 0;

            foreach (object item in second)
            {
                try
                {
                    ProcTest procTest = ((InitializerTest)state)._0002() ?? DeleteBroadcaster(item);
                    if (CountBroadcaster(item, null, procTest, state, reference2))
                    {
                        QueryBroadcaster(value, item);
                    }
                    else if (CustomizeBroadcaster(value, item, null, procTest, state, reference2))
                    {
                        InvokeBroadcaster(value, item, procTest, null, state, reference2);
                    }
                }
                catch (Exception ident)
                {
                    if (!CheckBroadcaster(obj, state, num, null, value._0001(), ident))
                    {
                        throw;
                    }
                    EnableClass(value, lengthpred);
                }
                finally
                {
                    num++;
                }
            }
            value._000F();
            if (flag)
            {
                value._0011();
            }
            wrapperProperty.RemoveAt(wrapperProperty.Count - 1);
            InitBroadcaster(value, state, obj);
        }
예제 #12
0
        /// <summary>
        /// 测试粘包分包
        /// </summary>
        /// <param name="clientSocket"></param>
        /// <param name="messageBase"></param>
        public static void MessageTest(ClientSocket clientSocket, MessageBase messageBase)
        {
            MessageTest messageTest = (MessageTest)messageBase;

            Debug.Log("收到客户端的分包测试数据:" + messageTest.RequestContent);

            messageTest.ResponseContent = "服务器收到客户端的粘包测试数据:";

            ServerSocket.Send(clientSocket, messageTest);
            ServerSocket.Send(clientSocket, messageTest);
            ServerSocket.Send(clientSocket, messageTest);
            ServerSocket.Send(clientSocket, messageTest);
            ServerSocket.Send(clientSocket, messageTest);
            ServerSocket.Send(clientSocket, messageTest);
        }
        private void PatchClass(RecordClassDispatcher i, Array result, MessageTest tag, ProductInstanceExpression connection2, InitializerTest ord3, ProductInstanceExpression asset4)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            ManageBroadcaster(i, tag, result);
            wrapperProperty.Add(result);
            bool num = ValidateClass(i, result, tag, connection2, ord3, asset4);

            FindClass(i, result, tag, connection2, i._0002(), ObserverIteratorMapping.CheckProperty <int>());
            if (num)
            {
                i._0011();
            }
            wrapperProperty.RemoveAt(wrapperProperty.Count - 1);
            InitBroadcaster(i, tag, result);
        }
            static void Main()
            {
                HRTimer.HiResTimer hrt = new HRTimer.HiResTimer();
                hrt.Start();
                Client client = new Client();

                CommChannelDemo.Message msg  = client.makeMessage("Sahil Shah", client.endPoint, client.endPoint);
                CommChannelDemo.Message msg1 = client.makeMessage("Rishi Dabre", client.endPoint, client.endPoint);
                string remoteEndPoint        = Comm <Client> .makeEndPoint("http://localhost", 8080);

                msg.body  = MessageTest.makeTestRequest();
                msg.to    = remoteEndPoint;
                msg1.body = MessageTest.makeAnotherTestRequest();
                msg1.to   = remoteEndPoint;
                client.comm.sndr.PostMessage(msg);
                client.comm.sndr.PostMessage(msg1);
                Console.Write("\n");
                Console.Write("\n");
                Console.Write(" ================================================================================================\n");
                Console.Write("\n                                    CLIENT WINDOW\n");
                Console.Write("\n ================================================================================================\n");
                Console.Write("\n\n  Client Sending Files to Repository for the test request---------------->Requirement #2");
                Console.Write("\n =======================================================\n");
                Client1 clnt = new Client1();

                clnt.channel = CreateServiceChannel("http://*****:*****@"../../../Service/DLL/logfile.txt");

                System.Console.WriteLine("{0}", text);
                hrt.Stop();
                Console.Write("\n\n  total elapsed time for Entire Execution = {0} micro seconds------>Requirement #12.\n", hrt.ElapsedMicroseconds);
                ((IChannel)clnt.channel).Close();
            }
        private void FindClass(RecordClassDispatcher instance, Array cont, MessageTest rule, ProductInstanceExpression ivk2, int cust3max, int[] last4)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            int num = last4.Length;

            int[] array = new int[num + 1];
            for (int i = 0; i < num; i++)
            {
                array[i] = last4[i];
            }
            instance._0003();
            for (int j = cont.GetLowerBound(num); j <= cont.GetUpperBound(num); j++)
            {
                array[num] = j;
                if (array.Length == cont.Rank)
                {
                    object value = cont.GetValue(array);
                    try
                    {
                        ProcTest procTest = ((InitializerTest)rule)._0002() ?? DeleteBroadcaster(value);
                        if (CountBroadcaster(value, null, procTest, rule, ivk2))
                        {
                            QueryBroadcaster(instance, value);
                        }
                        else if (CustomizeBroadcaster(instance, value, null, procTest, rule, ivk2))
                        {
                            InvokeBroadcaster(instance, value, procTest, null, rule, ivk2);
                        }
                    }
                    catch (Exception ident)
                    {
                        if (!CheckBroadcaster(cont, rule, j, null, instance._0001(), ident))
                        {
                            throw;
                        }
                        EnableClass(instance, cust3max + 1);
                    }
                }
                else
                {
                    FindClass(instance, cont, rule, ivk2, cust3max + 1, array);
                }
            }
            instance._000F();
        }
예제 #16
0
        public override int GetHashCode()
        {
            int result = Id.GetHashCode();

            result ^= Name.GetHashCode();
            result ^= MessageFrom.GetHashCode();
            result ^= MessageId.GetHashCode();
            result ^= MessagePassword.GetHashCode();
            result ^= MessageTo.GetHashCode();
            result ^= MessageTest.GetHashCode();
            result ^= MessageVersion.GetHashCode();
            result ^= ReceiveDirectory.GetHashCode();
            result ^= ReceiveDirectoryError.GetHashCode();
            result ^= ReceiveDirectoryError.GetHashCode();
            result ^= ReceiveDirectorySave.GetHashCode();
            result ^= SendDirectory.GetHashCode();

            return(result);
        }
    /// <summary>
    /// 测试分包粘包
    /// </summary>
    public static void SocketTest()
    {
        MessageTest messageTest = new MessageTest();

        messageTest.RequestContent = "dslkflksdjklfj lskdjflksjdklfjklsdjfklsjdklflksdfsdfsdfsdfdslkflks" +
                                     "djklfj lskdjflksjdklfjklsdjfklsjdklflksdfsdfsdfsdfdslkflksdjklfj lskdjflksjdklfjklsdjfklsjd" +
                                     "klflksdfsdfsdfsdfdslkflksdjklfj lskdjflksjdklfjklsdjfklsjdklflksdfsdfsdfsdfdslkflksdjklfj ls" +
                                     "kdjflksjdklfjklsdjfklsjdklflksdfsdfsdfsdfdslkflksdjklfj lskdjflksjdklfjklsdjfklsjdklflksdfsdfs" +
                                     "dfsdfdslkflksdjklfj lskdjflksjdklfjklsdjfklsjdklflksdfsdfsdfsdfdslkflksdjklfj lskdjflksjdklfjkds" +
                                     "dslkflksdjklfj lskdjflksjdklfjklsdjfklsjdklflksdfsdfsdfsdflkflksdjklfj lskdjflksjdklfjklsdjfklsjd" +
                                     "klflksdfsdfsdfsdflsdjfklsjdklflksdfsdfsdfsdfdslkflksdjklfj lskdjflksjdklfjklsdjfklsjdklflksdfsdfsdfs" +
                                     "dfdslkflksdjklfj lskdjflksjdklfjklsdjfklsjdklflksdfsdfsdfsdfdslkflksdjklfj lskdjflksjdklfjklsdjfkl" +
                                     "sjdklflksdfsdfsdfsdfdslkflksdjklfj lskdjflksjdklfjklsdjfklsjdklflksdfsdfsdfsdfdslkflksdjklfj lskdj" +
                                     "flksjdklfjklsdjfklsjdklflksdfsdfsdfsdfdslkflksdjklfj lskdjflksjdklfjklsdjfklsjdklflksdfsdfsdfsdfdsl" +
                                     "kflksdjklfj lskdjflksjdklfjklsdjfklsjdklflksdfsdfsdfsdf";
        NetManager.Instance.SendMessage(messageTest);
        NetManager.Instance.AddProtocalListener(ProtocolEnum.MessageTest, (resmsg) => {
            MessageTest msgTest = (MessageTest)resmsg;

            Debug.Log("测试回调服务器的数据:" + msgTest.ResponseContent);
        });
    }
예제 #18
0
        public static async Task SendMessageAsync()
        {
            await using var client = new ServiceBusClient(connectionString);
            var sender = client.CreateSender(queueName);

            while (true)
            {
                Console.Write("Informe a descrição: ");
                var description    = Console.ReadLine();
                var classTest      = new MyClass(Guid.NewGuid(), description);
                var messageTest    = new MessageTest <MyClass>(classTest);
                var serviceMessage = new ServiceBusMessage
                {
                    ContentType          = MediaTypeNames.Application.Json,
                    MessageId            = Guid.NewGuid().ToString(),
                    Body                 = new BinaryData(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(messageTest))),
                    ScheduledEnqueueTime = DateTimeOffset.Now.AddSeconds(-10)
                };

                await sender.SendMessageAsync(serviceMessage);

                Console.WriteLine($"Sent a single message to the queue: {queueName}");
            }
        }
        private void InvokeBroadcaster(RecordClassDispatcher last, object b, ProcTest proc, ProductInstanceExpression second2, InitializerTest second3, ProductInstanceExpression vis4)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (b == null)
            {
                last._0008();
                return;
            }
            BroadcasterError broadcasterError = second2?._0001() ?? vis4?._0002() ?? second3?._0001() ?? proc._0002() ?? baseProperty.CloneComposer(proc._0002()) ?? proc._0003();

            if (broadcasterError != null && broadcasterError._0001())
            {
                DisableClass(last, broadcasterError, b, proc, second3, vis4);
                return;
            }
            switch (proc._ErrorProperty)
            {
            case (ParameterFilterResolver)1:
                DefineBroadcaster(last, b, (PrototypeFilterResolver)proc, second2, second3, vis4);
                break;

            case (ParameterFilterResolver)2:
            {
                MessageTest messageTest = (MessageTest)proc;
                if (!messageTest._0001())
                {
                    VerifyClass(last, (IEnumerable)b, messageTest, second2, second3, vis4);
                }
                else
                {
                    PatchClass(last, (Array)b, messageTest, second2, second3, vis4);
                }
                break;
            }

            case (ParameterFilterResolver)3:
                ConcatBroadcaster(last, b, (ProccesorClassSpec)proc, second2, second3, vis4);
                break;

            case (ParameterFilterResolver)4:
                SetupBroadcaster(last, b, (StubIteratorMapping)proc);
                break;

            case (ParameterFilterResolver)5:
            {
                ParamClientBridge paramClientBridge = (ParamClientBridge)proc;
                IDictionary       dictionary        = b as IDictionary;
                IDictionary       attr;
                if (dictionary == null)
                {
                    IDictionary dictionary2 = paramClientBridge.CountClient(b);
                    attr = dictionary2;
                }
                else
                {
                    attr = dictionary;
                }
                CompareClass(last, attr, paramClientBridge, second2, second3, vis4);
                break;
            }

            case (ParameterFilterResolver)6:
                ResolveClass(last, (IDynamicMetaObjectProvider)b, (ProducerProperty)proc, second2, second3, vis4);
                break;

            case (ParameterFilterResolver)7:
                OrderClass(last, (ISerializable)b, (CollectionProperty)proc, second2, second3, vis4);
                break;

            case (ParameterFilterResolver)8:
                ((ParserFilterResolver)b)._0001(last, baseProperty._0001().ToArray());
                break;
            }
        }
예제 #20
0
    void CSCallback(Message msg)
    {
        MessageTest _msg = msg as MessageTest;

        Debug.Log("CSCallback " + +_msg.messageID + " " + _msg.field1);
    }
예제 #21
0
    public void OnMessage(NetworkMessage netMsg)
    {
        MessageTest msg = netMsg.ReadMessage <MessageTest>();

        Debug.Log("test: " + msg.text);
    }
예제 #22
0
 public async Task SendAwsSesNotifyMessage()
 {
     var messageSender = new AwsSesEmailMessageSender();
     await MessageTest.SendEmailNotifyMessage(messageSender);
 }
예제 #23
0
 public async Task SendTwilioSmsNotifyMessage()
 {
     var notifyMessageSender = new TwilioTextMessageSender("my-sid", "my-auth-token");
     await MessageTest.SendPhoneNotifyMessage(notifyMessageSender);
 }
예제 #24
0
		public void MergeOnlyOneClickEventSubscribed()
		{
			using (MessageTest messageTest = new MessageTest())
			{
				messageTest.m_nFirstOneClicked = 0;
				messageTest.m_nSecondOneClicked = 0;

				MenuExtender menuExtender = new MenuExtender();
				menuExtender.MessageMediator = new Mediator();
				menuExtender.MessageMediator.AddColleague(messageTest);

				MainMenu first = new MainMenu();
				MenuItem firstOne = new MenuItem("FirstOne");
				first.MenuItems.Add(new MenuItem(MenuMerge.MergeItems, 0, Shortcut.None, "First", null,
					null, null, new MenuItem[] { firstOne }));
				menuExtender.SetCommandId(firstOne, "FirstOne");

				MainMenu second = new MainMenu();
				MenuItem secondOne = new MenuItem("SecondOne");
				second.MenuItems.Add(new MenuItem(MenuMerge.MergeItems, 0, Shortcut.None, "Second", null,
					null, null, new MenuItem[] { secondOne }));
				menuExtender.SetCommandId(secondOne, "SecondOne");

				MainMenu result = menuExtender.MergeMenus(first, second);
				result.MenuItems[0].MenuItems[0].PerformClick();
				result.MenuItems[0].MenuItems[1].PerformClick();

				Assert.AreEqual(1, messageTest.m_nFirstOneClicked);
				Assert.AreEqual(1, messageTest.m_nSecondOneClicked);
				// Clean up the mess now.
				menuExtender.MessageMediator.RemoveColleague(messageTest);
				menuExtender.MessageMediator.Dispose();
				menuExtender.MessageMediator = null;
			}
		}
예제 #25
0
    public override void Execute(UFrameMessage msg)
    {
        MessageTest _msg = msg as MessageTest;

        Debug.LogError(msg.messageID + " " + _msg.field1 + " " + _msg.field2);
    }
예제 #26
0
 public CombatMessageStrategy(int priority, string message, MessageTest test) : this(priority, message, "", test)
 {
 }