当前位置: 首页>>代码示例>>C#>>正文


C# Common.Timestamp方法代码示例

本文整理汇总了C#中PubNubMessaging.Tests.Common.Timestamp方法的典型用法代码示例。如果您正苦于以下问题:C# Common.Timestamp方法的具体用法?C# Common.Timestamp怎么用?C# Common.Timestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PubNubMessaging.Tests.Common的用法示例。


在下文中一共展示了Common.Timestamp方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestUnencryptedSecretDetailedHistoryParams

		public void TestUnencryptedSecretDetailedHistoryParams()
		{
			Pubnub pubnub = new Pubnub(
				"demo",
				"demo",
				"secretkey",
				"",
				false);
			
			string channel = "hello_world";
			
			int totalMessages = 10;
			
			Common common = new Common();
			common.DeliveryStatus = false;
			common.Response = null;        
			
			long starttime = common.Timestamp(pubnub);
			
			SendMultipleIntMessages(0, totalMessages/2, channel, pubnub);
			
			long midtime = common.Timestamp(pubnub);
			
			SendMultipleIntMessages(totalMessages/2, totalMessages, channel, pubnub);
			
			long endtime = common.Timestamp(pubnub);
			
			pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested" ,"TestUnencryptedSecretDetailedHistoryParams1");
			
			common.DeliveryStatus = false;
			common.Response = null;
			Console.WriteLine("DetailedHistory with start & end");
			
			pubnub.DetailedHistory(channel, starttime, midtime, totalMessages / 2, true, common.DisplayReturnMessage);
			
			while (!common.DeliveryStatus) ;
			
			Console.WriteLine("DetailedHistory with start & reverse = true");
			
			ParseResponse(common.Response, 0, totalMessages/2, "");
			
			pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested" ,"TestUnencryptedSecretDetailedHistoryParams2");
			
			common.DeliveryStatus = false;
			common.Response = null;
			pubnub.DetailedHistory(channel, midtime, -1, totalMessages / 2, true, common.DisplayReturnMessage);
			
			while (!common.DeliveryStatus) ;
			
			Console.WriteLine("DetailedHistory with start & reverse = false");
			
			ParseResponse(common.Response, totalMessages/2, totalMessages, "");
			
			pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested" ,"TestUnencryptedSecretDetailedHistoryParams3");
			
			common.DeliveryStatus = false;
			common.Response = null;
			pubnub.DetailedHistory(channel, midtime, -1, totalMessages / 2, false, common.DisplayReturnMessage);
			
			while (!common.DeliveryStatus) ;
			
			Console.WriteLine("\n******* DetailedHistory Messages Received ******* ");
			
			ParseResponse(common.Response, 0, totalMessages/2, "");
		}
开发者ID:primohit,项目名称:pubnub-api,代码行数:65,代码来源:WhenDetailedHistoryIsRequested.cs

示例2: TestEncryptedDetailedHistorySSL

        public void TestEncryptedDetailedHistorySSL ()
        {
            Pubnub pubnub = new Pubnub (
                          Common.PublishKey,
                          Common.SubscribeKey,
                          "",
                          "enigma",
                          true);
            string channel = "hello_world_de15";

            int totalMessages = 10;

            Common common = new Common ();
            common.DeliveryStatus = false;
            common.Response = null;

            long starttime = common.Timestamp (pubnub);

            SendMultipleIntMessages (0, totalMessages, channel, pubnub);

            long midtime = common.Timestamp (pubnub);

            SendMultipleIntMessages (totalMessages, totalMessages / 2, channel, pubnub);

            long endtime = common.Timestamp (pubnub);
            common.WaitForResponse ();

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance ("WhenDetailedHistoryIsRequested", "TestEncryptedDetailedHistory");

            common.Response = null;
            common.DeliveryStatus = false;
            Thread.Sleep (1000);
            pubnub.DetailedHistory (channel, totalMessages, common.DisplayReturnMessage, common.DisplayReturnMessageDummy);

            common.WaitForResponse ();
            Console.WriteLine ("\n*********** DetailedHistory Messages Received*********** ");

            ParseResponse (common.Response, 0, totalMessages, "");
            pubnub.EndPendingRequests ();
        }
开发者ID:seeva92,项目名称:c-sharp,代码行数:40,代码来源:WhenDetailedHistoryIsRequested.cs

示例3: TestEncryptedDetailedHistory

		public void TestEncryptedDetailedHistory()
		{
			Pubnub pubnub = new Pubnub(
				"demo",
				"demo",
				"",
				"enigma",
				false);
			string channel = "hello_world";
			
			int totalMessages = 10;
			
			Common common = new Common();
			common.DeliveryStatus = false;
			common.Response = null;
			
			long starttime = common.Timestamp(pubnub);
			
			SendMultipleIntMessages(0, totalMessages, channel, pubnub);
			
			long midtime = common.Timestamp(pubnub);
			
			SendMultipleIntMessages(totalMessages, totalMessages/2, channel, pubnub);
			
			long endtime = common.Timestamp(pubnub);
			while (!common.DeliveryStatus) ;
			
			pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested", "TestEncryptedDetailedHistory");
			
			common.Response = null;
			common.DeliveryStatus = false;
			
			pubnub.DetailedHistory(channel, totalMessages, common.DisplayReturnMessage);
			
			while (!common.DeliveryStatus) ;
			Console.WriteLine("\n*********** DetailedHistory Messages Received*********** ");
			
			ParseResponse(common.Response, 0, totalMessages, "");
		}
开发者ID:primohit,项目名称:pubnub-api,代码行数:39,代码来源:WhenDetailedHistoryIsRequested.cs

示例4: TestUnencryptedSecretDetailedHistoryParams

        public void TestUnencryptedSecretDetailedHistoryParams ()
        {
            Pubnub pubnub = new Pubnub (
                          Common.PublishKey,
                          Common.SubscribeKey,
                          Common.SecretKey,
                          "",
                          false);

            string channel = "hello_world_de5";

            int totalMessages = 10;

            Common common = new Common ();
            common.DeliveryStatus = false;
            common.Response = null;        

            long starttime = common.Timestamp (pubnub);

            SendMultipleIntMessages (0, totalMessages / 2, channel, pubnub);

            long midtime = common.Timestamp (pubnub);

            SendMultipleIntMessages (totalMessages / 2, totalMessages, channel, pubnub);

            long endtime = common.Timestamp (pubnub);

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance ("WhenDetailedHistoryIsRequested", "TestUnencryptedSecretDetailedHistoryParams1");

            common.DeliveryStatus = false;
            common.Response = null;
            Console.WriteLine ("DetailedHistory with start & end");
            Thread.Sleep (1000);
            pubnub.DetailedHistory (channel, starttime, midtime, totalMessages / 2, true, common.DisplayReturnMessage, common.DisplayReturnMessageDummy);

            common.WaitForResponse ();

            Console.WriteLine ("DetailedHistory with start & reverse = true");

            ParseResponse (common.Response, 0, totalMessages / 2, "");

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance ("WhenDetailedHistoryIsRequested", "TestUnencryptedSecretDetailedHistoryParams2");

            common.DeliveryStatus = false;
            common.Response = null;
            Thread.Sleep (1000);
            pubnub.DetailedHistory (channel, midtime, -1, totalMessages / 2, true, common.DisplayReturnMessage, common.DisplayReturnMessageDummy);

            common.WaitForResponse ();

            Console.WriteLine ("DetailedHistory with start & reverse = false");

            ParseResponse (common.Response, totalMessages / 2, totalMessages, "");

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance ("WhenDetailedHistoryIsRequested", "TestUnencryptedSecretDetailedHistoryParams3");

            common.DeliveryStatus = false;
            common.Response = null;
            Thread.Sleep (1000);
            pubnub.DetailedHistory (channel, midtime, -1, totalMessages / 2, false, common.DisplayReturnMessage, common.DisplayReturnMessageDummy);

            common.WaitForResponse ();

            Console.WriteLine ("\n******* DetailedHistory Messages Received ******* ");

            ParseResponse (common.Response, 0, totalMessages / 2, "");
            pubnub.EndPendingRequests ();
        }
开发者ID:seeva92,项目名称:c-sharp,代码行数:68,代码来源:WhenDetailedHistoryIsRequested.cs


注:本文中的PubNubMessaging.Tests.Common.Timestamp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。