本文整理汇总了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, "");
}
示例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 ();
}
示例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, "");
}
示例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 ();
}