當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。