Permalink
Browse files

Merge branch 'master' of https://github.com/pubnub/pubnub-api

Conflicts:
	javascript/3.4/pubnub-3.4.min.js
	javascript/3.4/pubnub-3.4.min.js.gz
  • Loading branch information...
2 parents cdcc356 + e44776f commit 9724ee000ff4d397d43ee691f0009a80fcdd7361 @stephenlb stephenlb committed Dec 13, 2012
Showing with 6,331 additions and 36,146 deletions.
  1. +0 −42 csharp-mono/HistoryExample.cs
  2. BIN csharp-mono/Newtonsoft.Json.dll
  3. +0 −119 csharp-mono/PublishExample.cs
  4. BIN csharp-mono/Pubnub.dll
  5. BIN csharp-mono/PubnubCrypto.dll
  6. +0 −166 csharp-mono/PubnubTest.cs
  7. +0 −222 csharp-mono/README
  8. +0 −62 csharp-mono/SubscribeExample.cs
  9. BIN csharp-mono/System.Runtime.Serialization.Json.dll
  10. +0 −65 csharp-mono/System.Runtime.Serialization.Json.xml
  11. BIN csharp-mono/System.Web.Extensions.dll
  12. +0 −10,600 csharp-mono/System.Web.Extensions.xml
  13. +0 −28 csharp-mono/TimeExample.cs
  14. +0 −25 csharp-mono/UUIDExample.cs
  15. +0 −76 csharp-mono/UnsubscribeExample.cs
  16. 0 csharp-mono/gmcs
  17. +0 −28 csharp-mono/mono-build
  18. +0 −774 csharp-mono/src/Pubnub.cs
  19. +0 −157 csharp-mono/src/PubnubCrypto.cs
  20. +0 −372 csharp-mono/unit-test.cs
  21. +0 −226 csharp-silverlight/README
  22. +0 −18 csharp-silverlight/examples/HistoryExample.xaml
  23. +0 −67 csharp-silverlight/examples/HistoryExample.xaml.cs
  24. +0 −18 csharp-silverlight/examples/PublishExample.xaml
  25. +0 −91 csharp-silverlight/examples/PublishExample.xaml.cs
  26. +0 −42 csharp-silverlight/examples/PubnubTest.xaml
  27. +0 −144 csharp-silverlight/examples/PubnubTest.xaml.cs
  28. +0 −20 csharp-silverlight/examples/SubscribeExample.xaml
  29. +0 −46 csharp-silverlight/examples/SubscribeExample.xaml.cs
  30. +0 −17 csharp-silverlight/examples/TimeExample.xaml
  31. +0 −47 csharp-silverlight/examples/TimeExample.xaml.cs
  32. +0 −18 csharp-silverlight/examples/UUIDExample.xaml
  33. +0 −41 csharp-silverlight/examples/UUIDExample.xaml.cs
  34. +0 −29 csharp-silverlight/examples/UnsubscribeExample.xaml
  35. +0 −81 csharp-silverlight/examples/UnsubscribeExample.xaml.cs
  36. +0 −5,896 csharp-silverlight/resource/Newtonsoft.Json.Silverlight.XML
  37. BIN csharp-silverlight/resource/Newtonsoft.Json.Silverlight.dll
  38. BIN csharp-silverlight/resource/Newtonsoft.Json.dll
  39. +0 −6,905 csharp-silverlight/resource/Newtonsoft.Json.xml
  40. +0 −26 csharp-silverlight/src/Callback.cs
  41. +0 −757 csharp-silverlight/src/Pubnub.cs
  42. +0 −752 csharp-silverlight/src/PubnubCrypto.cs
  43. +0 −59 csharp-silverlight/src/Receiver.cs
  44. +0 −38 csharp-silverlight/src/UIThread.cs
  45. +0 −19 csharp-silverlight/test/unit-test.xaml
  46. +0 −397 csharp-silverlight/test/unit-test.xaml.cs
  47. +5 −2 javascript/3.4/build-minify-pubnub
  48. BIN javascript/3.4/pubnub-3.4.min.js.gz
  49. +5 −5 javascript/README.md
  50. +21 −0 javascript/build-minify-pubnub
  51. BIN javascript/comet.swf
  52. +0 −4 javascript/crossdomain.xml
  53. +155 −0 javascript/json.js
  54. BIN javascript/pubnub-3.3.1.min.js
  55. +269 −370 javascript/{pubnub-3.3.1.js → pubnub-3.4.js}
  56. +22 −0 javascript/pubnub-3.4.min.js
  57. BIN javascript/pubnub-3.4.min.js.gz
  58. +0 −47 javascript/pubnub.as
  59. BIN javascript/pubnub.swf
  60. +6 −15 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNub-Console/PubNub-Messaging.csproj
  61. BIN mono-for-linux/3.3.0.1/PubNub-Messaging/PubNub-Console/PubNub-Messaging.pidb
  62. +567 −409 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNub-Console/Pubnub.cs
  63. 0 ...part/PubNub-Messaging → mono-for-linux/3.3.0.1/PubNub-Messaging/PubNub-Console}/Pubnub_Example.cs
  64. +5 −11 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNub-Messaging.userprefs
  65. BIN mono-for-linux/3.3.0.1/PubNub-Messaging/PubNubTest/PubNub-Messaging.Tests.pidb
  66. +1 −10 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/PubNub-Messaging.csproj
  67. +567 −409 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/Pubnub.cs
  68. +213 −0 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/Pubnub_Example.cs
  69. +31 −28 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Messaging.userprefs
  70. +482 −481 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/EncryptionTests.cs
  71. +8 −5 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/PubNub-Messaging.Tests.csproj
  72. +133 −0 presence.md
  73. BIN silverlight-part/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.Tests.dll
  74. BIN silverlight-part/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.Tests.pdb
  75. BIN silverlight-part/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.exe
  76. BIN silverlight-part/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.pdb
  77. BIN silverlight-part/PubNub-Messaging.Tests/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  78. BIN silverlight-part/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.dll
  79. BIN silverlight-part/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.pdb
  80. BIN silverlight-part/PubNub-Messaging/bin/Debug/PubNub-Messaging.exe
  81. BIN silverlight-part/PubNub-Messaging/bin/Debug/PubNub-Messaging.pdb
  82. BIN silverlight-part/PubNub-Messaging/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  83. BIN silverlight-part/PubNub-Messaging/obj/x86/Debug/PubNub-Messaging.exe
  84. BIN silverlight-part/PubNub-Messaging/obj/x86/Debug/PubNub-Messaging.pdb
  85. BIN silverlight-part/PubnubSilverlight.Core/Bin/Debug/PubnubSilverlight.Core.dll
  86. BIN silverlight-part/PubnubSilverlight.Core/Bin/Debug/PubnubSilverlight.Core.pdb
  87. BIN silverlight-part/PubnubSilverlight.Core/Bin/Debug/PubnubSilverlight.Imports.dll
  88. BIN silverlight-part/PubnubSilverlight.Core/Bin/Debug/PubnubSilverlight.Imports.pdb
  89. +0 −2,699 silverlight-part/PubnubSilverlight.Core/PubnubV2.cs
  90. BIN silverlight-part/PubnubSilverlight.Core/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  91. BIN ...part/PubnubSilverlight.Core/obj/Debug/PubnubSilverlight.Core.csprojResolveAssemblyReference.cache
  92. BIN silverlight-part/PubnubSilverlight.Core/obj/Debug/PubnubSilverlight.Core.dll
  93. BIN silverlight-part/PubnubSilverlight.Core/obj/Debug/PubnubSilverlight.Core.pdb
  94. BIN ...light-part/PubnubSilverlight.Example.Web/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  95. BIN silverlight-part/PubnubSilverlight.Example.suo
  96. BIN silverlight-part/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Core.dll
  97. BIN silverlight-part/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Core.pdb
  98. BIN silverlight-part/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Example.pdb
  99. BIN silverlight-part/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Imports.dll
  100. BIN silverlight-part/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Imports.pdb
  101. BIN silverlight-part/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.UnitTest.dll
  102. BIN silverlight-part/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.UnitTest.pdb
  103. BIN silverlight-part/PubnubSilverlight.Example/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  104. BIN silverlight-part/PubnubSilverlight.Example/obj/Debug/PubnubSilverlight.Example.pdb
  105. +0 −13 silverlight-part/PubnubSilverlight.Example/obj/Debug/XapCacheFile.xml
  106. BIN silverlight-part/PubnubSilverlight.Imports/Bin/Debug/PubnubSilverlight.Imports.dll
  107. BIN silverlight-part/PubnubSilverlight.Imports/Bin/Debug/PubnubSilverlight.Imports.pdb
  108. BIN silverlight-part/PubnubSilverlight.Imports/obj/Debug/PubnubSilverlight.Imports.dll
  109. BIN silverlight-part/PubnubSilverlight.Imports/obj/Debug/PubnubSilverlight.Imports.pdb
  110. BIN silverlight-part/PubnubSilverlight.UnitTest/Bin/Debug/PubnubSilverlight.Core.dll
  111. BIN silverlight-part/PubnubSilverlight.UnitTest/Bin/Debug/PubnubSilverlight.Core.pdb
  112. BIN silverlight-part/PubnubSilverlight.UnitTest/Bin/Debug/PubnubSilverlight.Imports.dll
  113. BIN silverlight-part/PubnubSilverlight.UnitTest/Bin/Debug/PubnubSilverlight.Imports.pdb
  114. BIN silverlight-part/PubnubSilverlight.UnitTest/Bin/Debug/PubnubSilverlight.UnitTest.dll
  115. BIN silverlight-part/PubnubSilverlight.UnitTest/Bin/Debug/PubnubSilverlight.UnitTest.pdb
  116. BIN silverlight-part/PubnubSilverlight.UnitTest/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  117. BIN silverlight-part/PubnubSilverlight.UnitTest/obj/Debug/PubnubSilverlight.UnitTest.dll
  118. BIN silverlight-part/PubnubSilverlight.UnitTest/obj/Debug/PubnubSilverlight.UnitTest.pdb
  119. +0 −10 silverlight-part/PubnubSilverlight.UnitTest/obj/Debug/XapCacheFile.xml
  120. 0 ...lverlight.UnitTest/Bin/Debug → silverlight/3.3.0.1/Libraries}/ConcurrentHashtable_Silverlight.dll
  121. 0 ...Silverlight.UnitTest/Bin/Debug → silverlight/3.3.0.1/Libraries}/Microsoft.Silverlight.Testing.dll
  122. 0 ... → silverlight/3.3.0.1/Libraries}/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll
  123. 0 ...ht-part/PubnubSilverlight.UnitTest/Bin/Debug → silverlight/3.3.0.1/Libraries}/Newtonsoft.Json.dll
  124. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging.Tests/App.config
  125. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging.Tests/EncryptionTests.cs
  126. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging.Tests/Properties/AssemblyInfo.cs
  127. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging.Tests/PubNub-Messaging.Tests.csproj
  128. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging.Tests/PubNub-Messaging.Tests.csproj.user
  129. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging.Tests/WhenAClientIsPresented.cs
  130. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging.Tests/WhenAMessageIsPublished.cs
  131. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging.Tests/WhenDetailedHistoryIsRequested.cs
  132. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging.Tests/WhenGetRequestServerTime.cs
  133. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging.Tests/WhenSubscribedToAChannel.cs
  134. 0 ...12-11-27 22_45_26/Out → silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug}/Newtonsoft.Json.dll
  135. BIN silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.Tests.dll
  136. 0 ...ht-part → silverlight/3.3.0.1}/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.Tests.dll.config
  137. BIN silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.Tests.pdb
  138. BIN silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.exe
  139. BIN silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.pdb
  140. BIN silverlight/3.3.0.1/PubNub-Messaging.Tests/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  141. +9 −0 ...ight/3.3.0.1}/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.csproj.FileListAbsolute.txt
  142. BIN ...0.1}/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.csprojResolveAssemblyReference.cache
  143. BIN silverlight/3.3.0.1/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.dll
  144. BIN silverlight/3.3.0.1/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.pdb
  145. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging/DetailedHistory_Example.cs
  146. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging/Here_Now_Example.cs
  147. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging/PresenceUnsubscribe_Example.cs
  148. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging/Presence_Example.cs
  149. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging/PubNub-Messaging.csproj
  150. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging/PubNub-Messaging.csproj.user
  151. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging/Publish_Example.cs
  152. +414 −267 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging/Pubnub.cs
  153. +213 −0 silverlight/3.3.0.1/PubNub-Messaging/Pubnub_Example.cs
  154. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging/Subscribe_Example.cs
  155. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging/app.config
  156. 0 ...-PC 2012-11-27 22_38_02/Out → silverlight/3.3.0.1/PubNub-Messaging/bin/Debug}/Newtonsoft.Json.dll
  157. BIN silverlight/3.3.0.1/PubNub-Messaging/bin/Debug/PubNub-Messaging.exe
  158. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging/bin/Debug/PubNub-Messaging.exe.config
  159. BIN silverlight/3.3.0.1/PubNub-Messaging/bin/Debug/PubNub-Messaging.pdb
  160. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging/bin/Debug/PubNub-Messaging.vshost.exe
  161. 0 ...erlight-part → silverlight/3.3.0.1}/PubNub-Messaging/bin/Debug/PubNub-Messaging.vshost.exe.config
  162. 0 ...light-part → silverlight/3.3.0.1}/PubNub-Messaging/bin/Debug/PubNub-Messaging.vshost.exe.manifest
  163. 0 {silverlight-part → silverlight/3.3.0.1}/PubNub-Messaging/bin/Debug/pubnub-messaging.log
  164. 0 ...C 2012-11-27 22_36_09/Out → silverlight/3.3.0.1/PubNub-Messaging/bin/Release}/Newtonsoft.Json.dll
  165. BIN silverlight/3.3.0.1/PubNub-Messaging/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  166. +6 −0 ... silverlight/3.3.0.1}/PubNub-Messaging/obj/x86/Debug/PubNub-Messaging.csproj.FileListAbsolute.txt
  167. BIN silverlight/3.3.0.1/PubNub-Messaging/obj/x86/Debug/PubNub-Messaging.exe
  168. BIN silverlight/3.3.0.1/PubNub-Messaging/obj/x86/Debug/PubNub-Messaging.pdb
  169. BIN silverlight/3.3.0.1/PubNubMeter.Core/Bin/Debug/PubNubMeter.Core.dll
  170. BIN silverlight/3.3.0.1/PubNubMeter.Core/Bin/Debug/PubNubMeter.Core.pdb
  171. +18 −0 silverlight/3.3.0.1/PubNubMeter.Core/Meter.cs
  172. +35 −0 silverlight/3.3.0.1/PubNubMeter.Core/Properties/AssemblyInfo.cs
  173. +76 −0 silverlight/3.3.0.1/PubNubMeter.Core/PubNubMeter.Core.csproj
  174. +29 −0 silverlight/3.3.0.1/PubNubMeter.Core/PubNubMeter.Core.csproj.user
  175. 0 ...ample → silverlight/3.3.0.1/PubnubSilverlight.Core}/Bin/Debug/ConcurrentHashtable_Silverlight.dll
  176. 0 ...ubSilverlight.Example → silverlight/3.3.0.1/PubnubSilverlight.Core}/Bin/Debug/Newtonsoft.Json.dll
  177. BIN silverlight/3.3.0.1/PubnubSilverlight.Core/Bin/Debug/PubnubSilverlight.Core.dll
  178. BIN silverlight/3.3.0.1/PubnubSilverlight.Core/Bin/Debug/PubnubSilverlight.Core.pdb
  179. BIN silverlight/3.3.0.1/PubnubSilverlight.Core/Bin/Debug/PubnubSilverlight.Imports.dll
  180. BIN silverlight/3.3.0.1/PubnubSilverlight.Core/Bin/Debug/PubnubSilverlight.Imports.pdb
  181. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Core/ConcurrentDictionaryExtentions.cs
  182. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Core/Properties/AssemblyInfo.cs
  183. +1 −5 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Core/PubnubSilverlight.Core.csproj
  184. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Core/PubnubSilverlight.Core.csproj.user
  185. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Core/PubnubV3.cs
  186. +3,012 −2,863 ...-part/PubnubSilverlight.Core/PubnubV4.cs → silverlight/3.3.0.1/PubnubSilverlight.Core/PubnubV5.cs
  187. BIN silverlight/3.3.0.1/PubnubSilverlight.Core/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  188. +8 −0 ...ight/3.3.0.1}/PubnubSilverlight.Core/obj/Debug/PubnubSilverlight.Core.csproj.FileListAbsolute.txt
  189. BIN ....0.1/PubnubSilverlight.Core/obj/Debug/PubnubSilverlight.Core.csprojResolveAssemblyReference.cache
  190. BIN silverlight/3.3.0.1/PubnubSilverlight.Core/obj/Debug/PubnubSilverlight.Core.dll
  191. BIN silverlight/3.3.0.1/PubnubSilverlight.Core/obj/Debug/PubnubSilverlight.Core.pdb
  192. 0 ...light-part → silverlight/3.3.0.1}/PubnubSilverlight.Core/obj/Debug/ResolveAssemblyReference.cache
  193. 0 .../PubnubSilverlight.Core}/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
  194. 0 .../PubnubSilverlight.Core}/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
  195. 0 .../PubnubSilverlight.Core}/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
  196. BIN ...part → silverlight/3.3.0.1}/PubnubSilverlight.Example.Web/ClientBin/PubnubSilverlight.Example.xap
  197. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example.Web/Properties/AssemblyInfo.cs
  198. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example.Web/PubnubSilverlight.Web.csproj
  199. 0 ...light-part → silverlight/3.3.0.1}/PubnubSilverlight.Example.Web/PubnubSilverlight.Web.csproj.user
  200. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example.Web/PubnubSilverlightExample.aspx
  201. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example.Web/PubnubSilverlightExample.html
  202. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example.Web/Silverlight.js
  203. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example.Web/Web.Debug.config
  204. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example.Web/Web.Release.config
  205. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example.Web/Web.config
  206. 0 .../Debug → silverlight/3.3.0.1/PubnubSilverlight.Example.Web/bin}/PubnubSilverlight.Example.Web.dll
  207. 0 .../Debug → silverlight/3.3.0.1/PubnubSilverlight.Example.Web/bin}/PubnubSilverlight.Example.Web.pdb
  208. BIN ....Web/obj/Debug → silverlight/3.3.0.1/PubnubSilverlight.Example.Web/bin}/PubnubSilverlight.Web.dll
  209. BIN ....Web/obj/Debug → silverlight/3.3.0.1/PubnubSilverlight.Example.Web/bin}/PubnubSilverlight.Web.pdb
  210. BIN ...ht/3.3.0.1/PubnubSilverlight.Example.Web/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  211. 0 ...PubnubSilverlight.Example.Web/obj/Debug/PubnubSilverlight.Example.Web.csproj.FileListAbsolute.txt
  212. 0 ... → silverlight/3.3.0.1/PubnubSilverlight.Example.Web/obj/Debug}/PubnubSilverlight.Example.Web.dll
  213. 0 ... → silverlight/3.3.0.1/PubnubSilverlight.Example.Web/obj/Debug}/PubnubSilverlight.Example.Web.pdb
  214. +4 −0 ....3.0.1}/PubnubSilverlight.Example.Web/obj/Debug/PubnubSilverlight.Web.csproj.FileListAbsolute.txt
  215. BIN ....Web/bin → silverlight/3.3.0.1/PubnubSilverlight.Example.Web/obj/Debug}/PubnubSilverlight.Web.dll
  216. BIN ....Web/bin → silverlight/3.3.0.1/PubnubSilverlight.Example.Web/obj/Debug}/PubnubSilverlight.Web.pdb
  217. +12 −0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example.sln
  218. BIN silverlight/3.3.0.1/PubnubSilverlight.Example.suo
  219. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/App.xaml
  220. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/App.xaml.cs
  221. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/AppManifest.xaml
  222. 0 ...re → silverlight/3.3.0.1/PubnubSilverlight.Example}/Bin/Debug/ConcurrentHashtable_Silverlight.dll
  223. 0 ...part → silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/Microsoft.Silverlight.Testing.dll
  224. 0 ...bnubSilverlight.Example/Bin/Debug/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll
  225. 0 ...ubSilverlight.Core → silverlight/3.3.0.1/PubnubSilverlight.Example}/Bin/Debug/Newtonsoft.Json.dll
  226. BIN silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Core.dll
  227. BIN silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Core.pdb
  228. BIN ...mple/obj → silverlight/3.3.0.1/PubnubSilverlight.Example/Bin}/Debug/PubnubSilverlight.Example.dll
  229. BIN silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Example.pdb
  230. BIN ...ght-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Example.xap
  231. BIN silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Imports.dll
  232. BIN silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Imports.pdb
  233. BIN silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.UnitTest.dll
  234. BIN silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.UnitTest.pdb
  235. 0 ...→ silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/System.Windows.Controls.Navigation.dll
  236. 0 ...→ silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/System.Windows.Controls.Navigation.xml
  237. 0 ...light-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/System.Windows.Controls.dll
  238. 0 ...light-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/System.Windows.Controls.xml
  239. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/TestPage.html
  240. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/ar/System.Windows.Controls.resources.dll
  241. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/bg/System.Windows.Controls.resources.dll
  242. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/ca/System.Windows.Controls.resources.dll
  243. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/cs/System.Windows.Controls.resources.dll
  244. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/da/System.Windows.Controls.resources.dll
  245. 0 .../3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/de/System.Windows.Controls.Navigation.resources.dll
  246. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/de/System.Windows.Controls.resources.dll
  247. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/el/System.Windows.Controls.resources.dll
  248. 0 .../3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/es/System.Windows.Controls.Navigation.resources.dll
  249. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/es/System.Windows.Controls.resources.dll
  250. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/et/System.Windows.Controls.resources.dll
  251. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/eu/System.Windows.Controls.resources.dll
  252. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/fi/System.Windows.Controls.resources.dll
  253. 0 .../3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/fr/System.Windows.Controls.Navigation.resources.dll
  254. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/fr/System.Windows.Controls.resources.dll
  255. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/he/System.Windows.Controls.resources.dll
  256. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/hr/System.Windows.Controls.resources.dll
  257. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/hu/System.Windows.Controls.resources.dll
  258. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/id/System.Windows.Controls.resources.dll
  259. 0 .../3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/it/System.Windows.Controls.Navigation.resources.dll
  260. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/it/System.Windows.Controls.resources.dll
  261. 0 .../3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/ja/System.Windows.Controls.Navigation.resources.dll
  262. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/ja/System.Windows.Controls.resources.dll
  263. 0 .../3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/ko/System.Windows.Controls.Navigation.resources.dll
  264. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/ko/System.Windows.Controls.resources.dll
  265. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/lt/System.Windows.Controls.resources.dll
  266. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/lv/System.Windows.Controls.resources.dll
  267. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/ms/System.Windows.Controls.resources.dll
  268. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/nl/System.Windows.Controls.resources.dll
  269. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/no/System.Windows.Controls.resources.dll
  270. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/pl/System.Windows.Controls.resources.dll
  271. 0 ...verlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/pt-BR/System.Windows.Controls.resources.dll
  272. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/pt/System.Windows.Controls.resources.dll
  273. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/ro/System.Windows.Controls.resources.dll
  274. 0 .../3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/ru/System.Windows.Controls.Navigation.resources.dll
  275. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/ru/System.Windows.Controls.resources.dll
  276. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/sk/System.Windows.Controls.resources.dll
  277. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/sl/System.Windows.Controls.resources.dll
  278. 0 ...ght/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/sr-Cyrl-CS/System.Windows.Controls.resources.dll
  279. 0 ...ght/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/sr-Latn-CS/System.Windows.Controls.resources.dll
  280. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/sv/System.Windows.Controls.resources.dll
  281. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/th/System.Windows.Controls.resources.dll
  282. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/tr/System.Windows.Controls.resources.dll
  283. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/uk/System.Windows.Controls.resources.dll
  284. 0 ...silverlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/vi/System.Windows.Controls.resources.dll
  285. 0 ...0.1}/PubnubSilverlight.Example/Bin/Debug/zh-Hans/System.Windows.Controls.Navigation.resources.dll
  286. 0 ...rlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/zh-Hans/System.Windows.Controls.resources.dll
  287. 0 ...0.1}/PubnubSilverlight.Example/Bin/Debug/zh-Hant/System.Windows.Controls.Navigation.resources.dll
  288. 0 ...rlight/3.3.0.1}/PubnubSilverlight.Example/Bin/Debug/zh-Hant/System.Windows.Controls.resources.dll
  289. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/Dialogs/PublishMessageDialog.xaml
  290. 0 ...rlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/Dialogs/PublishMessageDialog.xaml.cs
  291. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/MainView.xaml
  292. +2 −2 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/MainView.xaml.cs
  293. 0 ...bSilverlight.UnitTest → silverlight/3.3.0.1/PubnubSilverlight.Example}/Properties/AppManifest.xml
  294. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/Properties/AssemblyInfo.cs
  295. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/PubnubSilverlight.Example.csproj
  296. 0 ...light-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/PubnubSilverlight.Example.csproj.user
  297. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/Styles/ButtonStyle.xaml
  298. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/Styles/Styles.xaml
  299. 0 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/Views/CodeExampleView.xaml
  300. +2 −1 {silverlight-part → silverlight/3.3.0.1}/PubnubSilverlight.Example/Views/CodeExampleView.xaml.cs
Sorry, we could not display the entire diff because too many files (804) changed.
View
42 csharp-mono/HistoryExample.cs
@@ -1,42 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Pubnub;
-
-namespace csharp
-{
- class HistoryExample
- {
- static public void Main()
- {
- //Initialize pubnub state
- pubnub objPubnub = new pubnub(
- "demo", // PUBLISH_KEY
- "demo", // SUBSCRIBE_KEY
- "demo", // SECRET_KEY
- "", // CIPHER_KEY (Cipher key is Optional)
- false // SSL_ON?
- );
- //channel name
- string channel = "hello-world";
-
- // History
- Dictionary<string, string> args = new Dictionary<string, string>();
- args.Add("channel", channel);
- args.Add("limit", 3.ToString());
- List<object> history = objPubnub.History(args);
- Console.Write("History Message: ");
- foreach (object history_message in history)
- {
- Console.Write("History Message: ");
- Console.WriteLine(history_message);
- }
-
- // Get PubNub Server Time
- object timestamp = objPubnub.Time();
- Console.WriteLine("Server Time: " + timestamp.ToString());
- Console.ReadKey();
- }
- }
-}
View
BIN csharp-mono/Newtonsoft.Json.dll
Binary file not shown.
View
119 csharp-mono/PublishExample.cs
@@ -1,119 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Runtime.Serialization;
-using System.Runtime.Serialization.Json;
-using Newtonsoft.Json.Linq;
-using System.Web.Script.Serialization;
-using Pubnub;
-
-namespace csharp
-{
- class PublishExample
- {
- static public void Main()
- {
- //Initialize pubnub state
- pubnub objPubnub = new pubnub(
- "demo", // PUBLISH_KEY
- "demo", // SUBSCRIBE_KEY
- "demo", // SECRET_KEY
- "", // CIPHER_KEY [Cipher key is Optional]
- false // SSL_ON?
- );
-
- //channel name
- string channel = "hello-world";
-
- // Publish String Message
- Dictionary<string, object> args = new Dictionary<string, object>();
- args.Add("channel", channel);
- args.Add("message", "Hello Csharp - mono");
- List<object> info = null;
-
- // publish Response
- info = objPubnub.Publish(args);
- if (info != null)
- {
- if (info.Count == 3) //success
- {
- Console.WriteLine("[ " + info[0].ToString() + ", " + info[1] + ", " + info[2] + "]");
- }
- else if (info.Count == 2) //error
- {
- Console.WriteLine("[" + info[0].ToString() + ", " + info[1] + "]");
- }
- }
- else
- {
- Console.WriteLine("Error in network connection");
- }
-
- // Publish Message in array format
- args = new Dictionary<string, object>();
- object[] objArr = new object[7];
-
- objArr[0] = "Sunday";
- objArr[1] = "Monday";
- objArr[2] = "Tuesday";
- objArr[3] = "Wednesday";
- objArr[4] = "Thursday";
- objArr[5] = "Friday";
- objArr[6] = "Saturday";
-
- args.Add("channel", channel);
- args.Add("message", objArr);
-
- // publish Response
- info = objPubnub.Publish(args);
- if (info != null)
- {
- if (info.Count == 3) //success
- {
- Console.WriteLine("[" + info[0].ToString() + ", " + info[1] + ", " + info[2] + "]");
- }
- else if (info.Count == 2) //error
- {
- Console.WriteLine("[" + info[0].ToString() + ", " + info[1] + "]");
- }
- }
- else
- {
- Console.WriteLine("Error in network connection");
- }
-
- // Publish message in Dictionary format
- args = new Dictionary<string, object>();
- Dictionary<string, object> objDict = new Dictionary<string, object>();
- Dictionary<string, object> val1 = new Dictionary<string, object>();
- objDict.Add("Student", "Male");
- val1.Add("Name", "Jhon");
- val1.Add("Age", "25");
- objDict.Add("Info", val1);
-
- args.Add("channel", channel);
- args.Add("message", objDict);
-
- // publish Response
- info = objPubnub.Publish(args);
- if (info != null)
- {
- if (info.Count == 3) //success
- {
- Console.WriteLine("[" + info[0].ToString() + ", " + info[1] + ", " + info[2] + "]");
- }
- else if (info.Count == 2) //error
- {
- Console.WriteLine("[" + info[0].ToString() + ", " + info[1] + "]");
- }
- }
- else
- {
- Console.WriteLine("Error in network connection");
- }
-
- Console.ReadKey();
- }
- }
-}
View
BIN csharp-mono/Pubnub.dll
Binary file not shown.
View
BIN csharp-mono/PubnubCrypto.dll
Binary file not shown.
View
166 csharp-mono/PubnubTest.cs
@@ -1,166 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Pubnub;
-
-namespace csharp
-{
- class PubnubTest
- {
- static public void Main()
- {
-
- // Initialize pubnub state
- pubnub objPubnub = new pubnub(
- "demo", // PUBLISH_KEY
- "demo", // SUBSCRIBE_KEY
- "demo", // SECRET_KEY
- "", // CIPHER_KEY (Cipher key is Optional)
- false // SSL_ON?
- );
-
- //define channel
- string channel = "hello-world";
-
- // Publish string message
- Dictionary<string, object> args = new Dictionary<string, object>();
- args.Add("channel", channel);
- args.Add("message", "Hello Csharp - mono");
- List<object> info = null;
-
- info = objPubnub.Publish(args);
- if (info != null)
- {
- if (info.Count == 3) //success
- {
- Console.WriteLine("[ " + info[0].ToString() + ", " + info[1] + ", " + info[2] + "]");
- }
- else if (info.Count == 2) //error
- {
- Console.WriteLine("[" + info[0].ToString() + ", " + info[1] + "]");
- }
- }
- else
- {
- Console.WriteLine("Error in network connection");
- }
-
- // Publish message in array format
- args = new Dictionary<string, object>();
- object[] objArr = new object[7];
- objArr[0] = "Sunday";
- objArr[1] = "Monday";
- objArr[2] = "Tuesday";
- objArr[3] = "Wednesday";
- objArr[4] = "Thursday";
- objArr[5] = "Friday";
- objArr[6] = "Saturday";
-
- args.Add("channel", channel);
- args.Add("message", objArr);
-
- // publish Response
- info = objPubnub.Publish(args);
- if (info != null)
- {
- if (info.Count == 3)
- {
- Console.WriteLine("[" + info[0].ToString() + ", " + info[1] + ", " + info[2] + "]");
- }
- else if (info.Count == 2)
- {
- Console.WriteLine("[" + info[0].ToString() + ", " + info[1] + "]");
- }
- }
- else
- {
- Console.WriteLine("Error in network connection");
- }
-
- args = new Dictionary<string, object>();
- Dictionary<string, object> objDict = new Dictionary<string, object>();
-
- objDict.Add("Name", "John");
- objDict.Add("Age", "25");
-
- args.Add("channel", channel);
- args.Add("message", objDict);
-
- info = objPubnub.Publish(args);
- if (info != null)
- {
- if (info.Count == 3)
- {
- Console.WriteLine("[" + info[0].ToString() + ", " + info[1] + ", " + info[2] + "]");
- }
- else if (info.Count == 2)
- {
- Console.WriteLine("[" + info[0].ToString() + ", " + info[1] + "]");
- }
- }
- else
- {
- Console.WriteLine("Error in network connection");
- }
-
- // History
- Dictionary<string, string> argsHist = new Dictionary<string, string>();
- argsHist.Add("channel", channel);
- argsHist.Add("limit", 3.ToString());
- List<object> history = objPubnub.History(argsHist);
- Console.Write("History Messages: ");
- foreach (object history_message in history)
- {
- Console.WriteLine(history_message);
- }
-
- //Get UUID
- string uuid = objPubnub.UUID();
- Console.WriteLine("UUID - " + uuid);
-
- // Get PubNub Server Time
- object timestamp = objPubnub.Time();
- Console.WriteLine("\nServer Time: " + timestamp.ToString());
-
- //Subscribe messages
- pubnub.Procedure Receiver = delegate(object message)
- {
- Console.WriteLine("Message - " + message);
- return true;
- };
- pubnub.Procedure ConnectCallback = delegate(object message)
- {
- Console.WriteLine(message);
- return true;
- };
- pubnub.Procedure DisconnectCallback = delegate(object message)
- {
- Console.WriteLine(message);
- return true;
- };
- pubnub.Procedure ReconnectCallback = delegate(object message)
- {
- Console.WriteLine(message);
- return true;
- };
- pubnub.Procedure ErrorCallback = delegate(object message)
- {
- Console.WriteLine(message);
- return true;
- };
- args = new Dictionary<string, object>();
- args.Add("channel", channel);
- args.Add("callback", Receiver); // callback to get response
- args.Add("connect_cb", ConnectCallback); // callback to get connect event
- args.Add("disconnect_cb", DisconnectCallback); // callback to get disconnect event
- args.Add("reconnect_cb", ReconnectCallback); // callback to get reconnect event
- args.Add("error_cb", ErrorCallback); // callback to get error event
-
- objPubnub.Subscribe(args);
-
- Console.ReadKey();
- }
-
- }
-}
View
222 csharp-mono/README
@@ -1,222 +0,0 @@
-## ---------------------------------------------------
-## UPDATE! UPDATE! UPDATE! UPDATE!
-## ---------------------------------------------------
-##
-## YOU MUST HAVE A PUBNUB ACCOUNT TO USE THE API.
-## http://www.pubnub.com/account
-##
-## ----------------------------------------------------
-
-## ---------------------------------------------------
-## PubNub 3.1 Web Data Push Cloud-Hosted API - C#-Mono
-## ---------------------------------------------------
-##
-## PubNub is a Massively Scalable Web Push Service for Web and Mobile Games.
-## This is a cloud-based service for broadcasting messages
-## to thousands of web and mobile clients simultaneously.
-
-## -------------------------------------------
-## ARE YOU COMPILING WITH .NET OLDER THAN 3.5?
-## -------------------------------------------
-## YOU MUST USE System.Web.Extensions.dll included in this directory.
-## YOU MUST HAVE MONO ON YOUR MACHINE
-##
-## TO USE THIS FOLLOW THE STEPS IN 'mono-build', INCLUDED IN THIS DIRECTORY.
-
-===============================================================================
-PubNub C# Client API Boiler Plate
-===============================================================================
-
--------------------------------------------------------------------------------
-C#: (Init)
--------------------------------------------------------------------------------
-
- pubnub objPubnub = new pubnub(
- "demo", // PUBLISH_KEY
- "demo", // SUBSCRIBE_KEY
- "demo", // SECRET_KEY
- "", //CIPHER_KEY (Cipher key is Optional)
- false // SSL_ON?
- );
-
--------------------------------------------------------------------------------
-C#: (Publish)
--------------------------------------------------------------------------------
-
- string channel = "test_channel"; // channel name
-
- // Publish String
- Dictionary<string, object> args = new Dictionary<string, object>();
- args.Add("channel", channel);
- args.Add("message", "Hello Csharp - mono");
-
- List<object> info = objPubnub.Publish(args);
-
- // Publish Response
- Console.WriteLine(info[0]); // 1
- Console.WriteLine(info[1]); // 'Demo' or "Error Message"
- Console.WriteLine(info[2]); // timetoken
-
- // Publish Array Of Messages
- args = new Dictionary<string, object>();
- string[] objArr = new string[7];
-
- objArr[0] = "Sunday";
- objArr[1] = "Monday";
- objArr[2] = "Tuesday";
- objArr[3] = "Wednesday";
- objArr[4] = "Thursday";
- objArr[5] = "Friday";
- objArr[6] = "Saturday";
-
- args.Add("channel", channel);
- args.Add("message", objArr);
- info = objPubnub.Publish(args);
-
- // Publish Response
- Console.WriteLine("[" + info[0].ToString() + ", " + info[1] + ", " + info[2] + "]");
-
- // Publish Message In Object Format
- args = new Dictionary<string, object>();
- Dictionary<string, object> objDict = new Dictionary<string, object>();
-
- objDict.Add("Name", "John");
- objDict.Add("Age", "25");
-
- args.Add("channel", channel);
- args.Add("message", objDict);
- info = objPubnub.Publish(args);
- Console.WriteLine("[" + info[0].ToString() + ", " + info[1] + ", " + info[2] + "]");
-
- Console.ReadKey();
-
--------------------------------------------------------------------------------
-C#: (Subscribe)
--------------------------------------------------------------------------------
-
- string channel = "test_channel"; // channel name
-
- pubnub.Procedure Receiver = delegate(object message)
- {
- Console.WriteLine("Message - " + message);
- return true;
- };
- pubnub.Procedure ConnectCallback = delegate(object message)
- {
- Console.WriteLine("Message - " + message);
- return true;
- };
- pubnub.Procedure DisconnectCallback = delegate(object message)
- {
- Console.WriteLine("Message - " + message);
- return true;
- };
- pubnub.Procedure ReconnectCallback = delegate(object message)
- {
- Console.WriteLine("Message - " + message);
- return true;
- };
- pubnub.Procedure ErrorCallback = delegate(object message)
- {
- Console.WriteLine("Message - " + message);
- return true;
- };
-
- args = new Dictionary<string, object>();
- args.Add("channel", channel);
- args.Add("callback", Receiver); // callback to get response
- args.Add("connect_cb", ConnectCallback); // callback to get connect event
- args.Add("disconnect_cb", DisconnectCallback); // callback to get disconnect event
- args.Add("reconnect_cb", ReconnectCallback); // callback to get reconnect event
- args.Add("error_cb", ErrorCallback); // callback to get error event
-
- objPubnub.Subscribe(args);
-
--------------------------------------------------------------------------------
-C#: (History)
--------------------------------------------------------------------------------
-
- string channel = "test_channel";
-
- // History
- Dictionary<string, string> args = new Dictionary<string, string>();
- args.Add("channel", channel);
- args.Add("limit", 3.ToString()); //limit of messages to receive
- List<object> history = objPubnub.History(args);
- foreach (object history_message in history)
- {
- Console.Write("History Message: ");
- Console.WriteLine(history_message);
- }
- Console.ReadKey();
-
--------------------------------------------------------------------------------
-C#: (Time)
--------------------------------------------------------------------------------
- // Get PubNub Server Time
- object timestamp = objPubnub.Time();
- Console.WriteLine("Server Time: " + timestamp.ToString());
-
--------------------------------------------------------------------------------
-C#: (UUID)
--------------------------------------------------------------------------------
-
- string channel = "test_channel"; // channel name
-
- // Print Unique identifier
- Console.WriteLine("UUID - " + objPubnub.UUID());
- Console.ReadKey();
-
--------------------------------------------------------------------------------
-C#: (Unsubscribe)
--------------------------------------------------------------------------------
- // Unsubscribe to channel
- string channel = "test_channel"; // channel name
-
- pubnub.Procedure Receiver = delegate(object message)
- {
- Console.WriteLine("Message - " + message);
- Dictionary<string, object> arg = new Dictionary<string, object>();
- arg.Add("channel", channel);
- //Unsubscribe messages
- objPubnub.Unsubscribe(arg);
- return true;
- };
- pubnub.Procedure ConnectCallback = delegate(object message)
- {
- Console.WriteLine("Message - " + message);
- // Publish String Message
- Dictionary<string, object> publish = new Dictionary<string, object>();
- publish.Add("channel", channel);
- publish.Add("message", "Hello World!!!!");
-
- // publish Response
- objPubnub.Publish(publish);
- return true;
- };
- pubnub.Procedure DisconnectCallback = delegate(object message)
- {
- Console.WriteLine("Message - " + message);
- return true;
- };
- pubnub.Procedure ReconnectCallback = delegate(object message)
- {
- Console.WriteLine("Message - " + message);
- return true;
- };
- pubnub.Procedure ErrorCallback = delegate(object message)
- {
- Console.WriteLine("Message - " + message);
- return true;
- };
-
- args = new Dictionary<string, object>();
- args.Add("channel", channel);
- args.Add("callback", Receiver); // callback to get response
- args.Add("connect_cb", ConnectCallback); // callback to get connect event
- args.Add("disconnect_cb", DisconnectCallback); // callback to get disconnect event
- args.Add("reconnect_cb", ReconnectCallback); // callback to get reconnect event
- args.Add("error_cb", ErrorCallback); // callback to get error event
-
- objPubnub.Subscribe(args);
-
View
62 csharp-mono/SubscribeExample.cs
@@ -1,62 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Pubnub;
-
-namespace csharp
-{
- class SubscribeExample
- {
- static public void Main()
- {
- //Initialize pubnub state
- pubnub objPubnub = new pubnub(
- "demo", // PUBLISH_KEY
- "demo", // SUBSCRIBE_KEY
- "demo", // SECRET_KEY
- "", // CIPHER_KEY (Cipher key is Optional)
- false // SSL_ON?
- );
- //channel name
- string channel = "hello-world";
-
- pubnub.Procedure Receiver = delegate(object message)
- {
- Console.WriteLine("Message - " + message);
- return true;
- };
- pubnub.Procedure ConnectCallback = delegate(object message)
- {
- Console.WriteLine(message);
- return true;
- };
- pubnub.Procedure DisconnectCallback = delegate(object message)
- {
- Console.WriteLine(message);
- return true;
- };
- pubnub.Procedure ReconnectCallback = delegate(object message)
- {
- Console.WriteLine(message);
- return true;
- };
- pubnub.Procedure ErrorCallback = delegate(object message)
- {
- Console.WriteLine(message);
- return true;
- };
-
- Dictionary<string, object> args = new Dictionary<string, object>();
- args.Add("channel", channel);
- args.Add("callback", Receiver); // callback to get response
- args.Add("connect_cb", ConnectCallback); // callback to get connect event
- args.Add("disconnect_cb", DisconnectCallback); // callback to get disconnect event
- args.Add("reconnect_cb", ReconnectCallback); // callback to get reconnect event
- args.Add("error_cb", ErrorCallback); // callback to get error event
-
- //Subscribe messages
- objPubnub.Subscribe(args);
- }
- }
-}
View
BIN csharp-mono/System.Runtime.Serialization.Json.dll
Binary file not shown.
View
65 csharp-mono/System.Runtime.Serialization.Json.xml
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<doc>
- <assembly>
- <name>System.Runtime.Serialization.Json</name>
- </assembly>
- <members>
- <member name="T:System.Runtime.Serialization.Json.JsonReaderWriterFactory">
- <summary>Produces instances of <see cref="T:System.Xml.XmlDictionaryReader" /> that can read data encoded with JavaScript Object Notation (JSON) from a stream or buffer and map it to an XML Infoset, and produces instances of <see cref="T:System.Xml.XmlDictionaryWriter" /> that can map an XML Infoset to JSON and write JSON-encoded data to a stream. </summary>
- </member>
- <member name="M:System.Runtime.Serialization.Json.JsonReaderWriterFactory.CreateJsonReader(System.Byte[],System.Int32,System.Int32,System.Xml.XmlDictionaryReaderQuotas)">
- <summary>Creates an <see cref="T:System.Xml.XmlDictionaryReader" /> that can map a buffer encoded with JavaScript Object Notation (JSON), of a specified size and offset, to an XML Infoset.</summary>
- <returns>An <see cref="T:System.Xml.XmlDictionaryReader" /> that can read JSON.</returns>
- <param name="buffer">The input <see cref="T:System.Byte" /> buffer array from which to read.</param>
- <param name="offset">Starting position from which to read in <paramref name="buffer" />.</param>
- <param name="count">Number of bytes that can be read from <paramref name="buffer" />.</param>
- <param name="quotas">The <see cref="T:System.Xml.XmlDictionaryReaderQuotas" /> must be set to <see cref="P:System.Xml.XmlDictionaryReaderQuotas.Max" /> in Silverlight version 4 Release Candidate applications.</param>
- <exception cref="T:System.ArgumentNullException">
- <paramref name="stream" /> is null.</exception>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="offset" /> is negative or exceeds the <paramref name="buffer" /> length.</exception>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <paramref name="count" /> is negative or exceeds the <paramref name="buffer" /> length minus the <paramref name="offset" />.</exception>
- </member>
- <member name="M:System.Runtime.Serialization.Json.JsonReaderWriterFactory.CreateJsonReader(System.Byte[],System.Xml.XmlDictionaryReaderQuotas)">
- <summary>Creates an <see cref="T:System.Xml.XmlDictionaryReader" /> that can map a specified buffer encoded with JavaScript Object Notation (JSON) to an XML Infoset.</summary>
- <returns>An <see cref="T:System.Xml.XmlDictionaryReader" /> that can process JavaScript Object Notation (JSON) data from the buffer specified.</returns>
- <param name="buffer">The input <see cref="T:System.Byte" /> buffer array from which to read.</param>
- <param name="quotas">The <see cref="T:System.Xml.XmlDictionaryReaderQuotas" /> must be set to <see cref="P:System.Xml.XmlDictionaryReaderQuotas.Max" /> in Silverlight version 4 Release Candidate applications used to prevent Denial of Service (DoS) attacks when reading untrusted data. </param>
- <exception cref="T:System.ArgumentNullException">
- <paramref name="buffer" /> is null.</exception>
- </member>
- <member name="M:System.Runtime.Serialization.Json.JsonReaderWriterFactory.CreateJsonReader(System.IO.Stream,System.Xml.XmlDictionaryReaderQuotas)">
- <summary>Creates an <see cref="T:System.Xml.XmlDictionaryReader" /> that can map a specified stream encoded with JavaScript Object Notation (JSON) to an XML Infoset.</summary>
- <returns>An <see cref="T:System.Xml.XmlDictionaryReader" /> that can read JSON.</returns>
- <param name="stream">The input <see cref="T:System.IO.Stream" /> from which to read.</param>
- <param name="quotas">The <see cref="T:System.Xml.XmlDictionaryReaderQuotas" /> must be set to <see cref="P:System.Xml.XmlDictionaryReaderQuotas.Max" /> in Silverlight version 4 Release Candidate applications. </param>
- <exception cref="T:System.ArgumentNullException">
- <paramref name="stream" /> is null.</exception>
- </member>
- <member name="M:System.Runtime.Serialization.Json.JsonReaderWriterFactory.CreateJsonWriter(System.IO.Stream)">
- <summary>Creates an <see cref="T:System.Xml.XmlDictionaryWriter" /> that writes data encoded with JSON to a stream using a UTF-8 character encoding.</summary>
- <returns>An <see cref="T:System.Xml.XmlDictionaryWriter" /> that writes data encoded with JSON to the stream from an XML Infoset.</returns>
- <param name="stream">The output <see cref="T:System.IO.Stream" /> for the JSON writer.</param>
- <exception cref="T:System.ArgumentNullException">
- <paramref name="stream" /> is null.</exception>
- </member>
- <member name="M:System.Runtime.Serialization.Json.JsonReaderWriterFactory.CreateJsonWriter(System.IO.Stream,System.Text.Encoding)">
- <summary>Creates an <see cref="T:System.Xml.XmlDictionaryWriter" /> that writes data encoded with JSON to a stream with a specified character encoding.</summary>
- <returns>An <see cref="T:System.Xml.XmlDictionaryWriter" /> that writes data encoded with JSON to the stream from an XML Infoset.</returns>
- <param name="stream">The output <see cref="T:System.IO.Stream" /> for the JSON writer.</param>
- <param name="encoding">The <see cref="T:System.Text.Encoding" /> that specifies the character encoding used by the writer. The default encoding is UTF-8.</param>
- <exception cref="T:System.ArgumentNullException">
- <paramref name="stream" /> or <paramref name="encoding" /> is null.</exception>
- </member>
- <member name="M:System.Runtime.Serialization.Json.JsonReaderWriterFactory.CreateJsonWriter(System.IO.Stream,System.Text.Encoding,System.Boolean)">
- <summary>Creates an <see cref="T:System.Xml.XmlDictionaryWriter" /> that writes data encoded with JSON to a stream with a specified character encoding and that specifies whether the output stream is closed by the writer when it is done.</summary>
- <returns>An <see cref="T:System.Xml.XmlDictionaryWriter" /> that writes data encoded with JSON to the stream from an XML Infoset.</returns>
- <param name="stream">The output <see cref="T:System.IO.Stream" /> for the JSON writer.</param>
- <param name="encoding">The <see cref="T:System.Text.Encoding" /> that specifies the character encoding used by the writer. The default encoding is UTF-8.</param>
- <param name="ownsStream">If true, the output stream is closed by the writer when done; otherwise, false. The default value is true.</param>
- <exception cref="T:System.ArgumentNullException">
- <paramref name="stream" /> or <paramref name="encoding" /> is null.</exception>
- </member>
- </members>
-</doc>
View
BIN csharp-mono/System.Web.Extensions.dll
Binary file not shown.
View
10,600 csharp-mono/System.Web.Extensions.xml
0 additions, 10,600 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
28 csharp-mono/TimeExample.cs
@@ -1,28 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Pubnub;
-
-namespace csharp
-{
- class TimeExample
- {
- static public void Main()
- {
- //Initialize pubnub state
- pubnub objPubnub = new pubnub(
- "demo", // PUBLISH_KEY
- "demo", // SUBSCRIBE_KEY
- "demo", // SECRET_KEY
- "", // CIPHER_KEY (Cipher key is Optional)
- false // SSL_ON?
- );
- // Get PubNub Server Time
- object timestamp = objPubnub.Time();
- Console.WriteLine("\nServer Time: " + timestamp.ToString());
- Console.ReadKey();
- }
-
- }
-}
View
25 csharp-mono/UUIDExample.cs
@@ -1,25 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Pubnub;
-
-namespace csharp
-{
- class UUIDExample
- {
- static public void Main()
- {
- //Initialize pubnub state
- pubnub objPubnub = new pubnub(
- "demo", // PUBLISH_KEY
- "demo", // SUBSCRIBE_KEY
- "demo", // SECRET_KEY
- "", // CIPHER_KEY [Cipher key is Optional]
- false // SSL_ON?
- );
- Console.WriteLine("UUID - " + objPubnub.UUID());
- Console.ReadKey();
- }
- }
-}
View
76 csharp-mono/UnsubscribeExample.cs
@@ -1,76 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Pubnub;
-
-namespace csharp
-{
- class UnsubscribeExample
- {
- static public void Main()
- {
- //Initialize pubnub state
- pubnub objPubnub = new pubnub(
- "demo", // PUBLISH_KEY
- "demo", // SUBSCRIBE_KEY
- "demo", // SECRET_KEY
- "", // CIPHER_KEY (Cipher key is Optional)
- false // SSL_ON?
- );
- //channel name
- string channel = "hello-world";
-
- pubnub.Procedure Receiver = delegate(object message)
- {
- Console.WriteLine("Message - " + message);
-
- Dictionary<string, object> arg = new Dictionary<string, object>();
- arg.Add("channel", channel);
- //Unsubscribe messages
- objPubnub.Unsubscribe(arg);
- return true;
- };
- pubnub.Procedure ConnectCallback = delegate(object message)
- {
- Console.WriteLine(message);
-
- // Publish String Message
- Dictionary<string, object> publish = new Dictionary<string, object>();
- publish.Add("channel", channel);
- publish.Add("message", "Hello World!!!!");
-
- // publish Response
- objPubnub.Publish(publish);
- return true;
- };
- pubnub.Procedure DisconnectCallback = delegate(object message)
- {
- Console.WriteLine(message);
- return true;
- };
- pubnub.Procedure ReconnectCallback = delegate(object message)
- {
- Console.WriteLine(message);
- return true;
- };
- pubnub.Procedure ErrorCallback = delegate(object message)
- {
- Console.WriteLine(message);
- return true;
- };
-
- Dictionary<string, object> args = new Dictionary<string, object>();
- args.Add("channel", channel);
- args.Add("callback", Receiver); // callback to get response
- args.Add("connect_cb", ConnectCallback); // callback to get connect event
- args.Add("disconnect_cb", DisconnectCallback); // callback to get disconnect event
- args.Add("reconnect_cb", ReconnectCallback); // callback to get reconnect event
- args.Add("error_cb", ErrorCallback); // callback to get error event
-
- //Subscribe messages
- objPubnub.Subscribe(args);
- Console.ReadKey();
- }
- }
-}
View
0 csharp-mono/gmcs
No changes.
View
28 csharp-mono/mono-build
@@ -1,28 +0,0 @@
-
-1 . install mono
-2 . open two command promp of mono for publish and subscribe
-
-3 .cd to the code folder on both command prompt
-4. on 1st command prompt run the following command
-
-// Subscribe messages
-> gmcs SubscribeExample.cs -r:System.Web.Extensions.dll -r:Newtonsoft.Json.dll -r:System.Runtime.Serialization.Json.dll -r:PubnubCrypto.dll -r:Pubnub.dll
-> mono --debug SubscribeExample.exe
-
-5. on 2nd command prompt run the following command
-
-// Publish messages
->gmcs PublishExample.cs -r:System.Web.Extensions.dll -r:Newtonsoft.Json.dll -r:System.Runtime.Serialization.Json.dll -r:PubnubCrypto.dll -r:Pubnub.dll
->mono --debug PublishExample.exe
-
-// Get history of published messages depend on limit
->gmcs HistoryExample.cs -r:System.Web.Extensions.dll -r:Newtonsoft.Json.dll -r:System.Runtime.Serialization.Json.dll -r:PubnubCrypto.dll -r:Pubnub.dll
->mono --debug HistoryExample.exe
-
-// Get UUID
->gmcs UUIDExample.cs -r:System.Web.Extensions.dll -r:Newtonsoft.Json.dll -r:System.Runtime.Serialization.Json.dll -r:PubnubCrypto.dll -r:Pubnub.dll
->mono --debug UUIDExample.exe
-
-// Get server time
->gmcs TimeExample.cs -r:System.Web.Extensions.dll -r:Newtonsoft.Json.dll -r:System.Runtime.Serialization.Json.dll -r:PubnubCrypto.dll -r:Pubnub.dll
->mono --debug TimeExample.exe
View
774 csharp-mono/src/Pubnub.cs
@@ -1,774 +0,0 @@
-using System;
-using System.IO;
-using System.Net;
-using System.Text;
-using System.Collections;
-using System.Collections.Generic;
-using System.Security.Cryptography;
-using System.Web.Script.Serialization;
-using System.Linq;
-using Newtonsoft.Json.Linq;
-using System.Runtime.Serialization;
-using System.Runtime.Serialization.Json;
-using System.ComponentModel;
-using Newtonsoft.Json;
-using System.Threading;
-using System.IO.Compression;
-using PubnubCrypto;
-
-/**
- * PubNub 3.1 Real-time Push Cloud API
- *
- * @author Stephen Blum
- * @package pubnub
- */
-namespace Pubnub
-{
- public class Channel_status
- {
- public string channel;
- public bool connected, first;
- }
- public class pubnub
- {
- private string ORIGIN = "pubsub.pubnub.com";
- private string PUBLISH_KEY = "";
- private string SUBSCRIBE_KEY = "";
- private string SECRET_KEY = "";
- private string CIPHER_KEY = "";
- private bool SSL = false;
-
- private ManualResetEvent webRequestDone;
- volatile private bool abort;
- public delegate bool Procedure(object message);
- private List<Channel_status> subscriptions;
-
- /**
- * PubNub 3.1 with cipher key
- *
- * Prepare PubNub Class State.
- *
- * @param string Publish Key.
- * @param string Subscribe Key.
- * @param string Secret Key.
- * @param string Cipher Key.
- * @param bool SSL Enabled.
- */
- public pubnub(
- string publish_key,
- string subscribe_key,
- string secret_key,
- string cipher_key,
- bool ssl_on
- )
- {
- this.init(publish_key, subscribe_key, secret_key, cipher_key, ssl_on);
- }
-
- /**
- * PubNub 3.0 Compatibility
- *
- * Prepare PubNub Class State.
- *
- * @param string Publish Key.
- * @param string Subscribe Key.
- * @param string Secret Key.
- * @param bool SSL Enabled.
- */
- public pubnub(
- string publish_key,
- string subscribe_key,
- string secret_key,
- bool ssl_on
- )
- {
- this.init(publish_key, subscribe_key, secret_key, "", ssl_on);
- }
-
- /**
- * PubNub 2.0 Compatibility
- *
- * Prepare PubNub Class State.
- *
- * @param string Publish Key.
- * @param string Subscribe Key.
- */
- public pubnub(
- string publish_key,
- string subscribe_key
- )
- {
- this.init(publish_key, subscribe_key, "", "", false);
- }
-
- /**
- * PubNub 3.0 without SSL
- *
- * Prepare PubNub Class State.
- *
- * @param string Publish Key.
- * @param string Subscribe Key.
- * @param string Secret Key.
- */
- public pubnub(
- string publish_key,
- string subscribe_key,
- string secret_key
- )
- {
- this.init(publish_key, subscribe_key, secret_key, "", false);
- }
-
- /**
- * Init
- *
- * Prepare PubNub Class State.
- *
- * @param string Publish Key.
- * @param string Subscribe Key.
- * @param string Secret Key.
- * @param string Cipher Key.
- * @param bool SSL Enabled.
- */
- public void init(
- string publish_key,
- string subscribe_key,
- string secret_key,
- string cipher_key,
- bool ssl_on
- )
- {
- this.PUBLISH_KEY = publish_key;
- this.SUBSCRIBE_KEY = subscribe_key;
- this.SECRET_KEY = secret_key;
- this.CIPHER_KEY = cipher_key;
- this.SSL = ssl_on;
-
- // SSL On?
- if (this.SSL)
- {
- this.ORIGIN = "https://" + this.ORIGIN;
- }
- else
- {
- this.ORIGIN = "http://" + this.ORIGIN;
- }
- webRequestDone = new ManualResetEvent(true);
- }
-
- /**
- * Publish
- *
- * Send a message to a channel.
- *
- * @param Dictionary<string, object> args
- * args is string channel name and object message
- * @return List<object> info.
- */
- public List<object> Publish(Dictionary<string, object> args)
- {
- string channel = args["channel"].ToString();
- object message = args["message"];
-
- JavaScriptSerializer serializer = new JavaScriptSerializer();
- clsPubnubCrypto pc = new clsPubnubCrypto(this.CIPHER_KEY);
-
- if (this.CIPHER_KEY.Length > 0)
- {
- if (message.GetType() == typeof(string))
- {
- message = pc.encrypt(message.ToString());
- }
- else if (message.GetType() == typeof(object[]))
- {
- message = pc.encrypt((object[])message);
- }
- else if (message.GetType() == typeof(Dictionary<string, object>))
- {
- Dictionary<string, object> dict = (Dictionary<string, object>)message;
- message = pc.encrypt(dict);
- }
- }
-
- // Generate String to Sign
- string signature = "0";
- if (this.SECRET_KEY.Length > 0)
- {
- StringBuilder string_to_sign = new StringBuilder();
- string_to_sign
- .Append(this.PUBLISH_KEY)
- .Append('/')
- .Append(this.SUBSCRIBE_KEY)
- .Append('/')
- .Append(this.SECRET_KEY)
- .Append('/')
- .Append(channel)
- .Append('/')
- .Append(serializer.Serialize(message));
-
- // Sign Message
- signature = getHMACSHA256(string_to_sign.ToString());
- }
-
- // Build URL
- List<string> url = new List<string>();
- url.Add("publish");
- url.Add(this.PUBLISH_KEY);
- url.Add(this.SUBSCRIBE_KEY);
- url.Add(signature);
- url.Add(channel);
- url.Add("0");
- url.Add(serializer.Serialize(message));
-
- // Return JSONArray
- return _request(url);
- }
-
- /**
- * Subscribe
- *
- * This function is BLOCKING.
- * Listen for a message on a channel.
- *
- * @param Dictionary<string,object> args.
- * args contains channel name and Procedure function callback.
- */
- public void Subscribe(Dictionary<string, object> args)
- {
- args.Add("timestamp", 0);
- this._subscribe(args);
- }
-
- /**
- * _subscribe - Private Interface
- *
- * @param Dictionary<string, object> args
- * args is channel name and Procedure function callback and timetoken
- *
- */
- private void _subscribe(Dictionary<string, object> args)
- {
- bool is_disconnect = false;
- bool is_alreadyConnect = false;
- Procedure callback=null, connect_cb, disconnect_cb, reconnect_cb, error_cb;
- clsPubnubCrypto pc = new clsPubnubCrypto(this.CIPHER_KEY);
-
- string channel = args["channel"].ToString();
- object timetoken = args["timestamp"];
- // Validate Arguments
- if (args["callback"] != null)
- {
- callback = (Procedure)args["callback"];
- }
- else
- {
- Console.WriteLine("Invalid Callback.");
- }
- if(args.ContainsKey("connect_cb") && args["connect_cb"] != null)
- connect_cb = (Procedure)args["connect_cb"];
- else
- connect_cb = new Procedure(doNothing);
- if (args.ContainsKey("disconnect_cb") && args["disconnect_cb"] != null)
- disconnect_cb = (Procedure)args["disconnect_cb"];
- else
- disconnect_cb = new Procedure(doNothing);
- if (args.ContainsKey("reconnect_cb") && args["reconnect_cb"] != null)
- reconnect_cb = (Procedure)args["reconnect_cb"];
- else
- reconnect_cb = new Procedure(doNothing);
- if (args.ContainsKey("error_cb") && args["error_cb"] != null)
- error_cb = (Procedure)args["error_cb"];
- else
- error_cb = (Procedure)args["callback"];
- if (channel == null || channel =="")
- {
- error_cb("Invalid Channel.");
- return;
- }
- // Ensure Single Connection
- if (subscriptions != null && subscriptions.Count > 0)
- {
- bool channel_exist = false;
- foreach (Channel_status cs in subscriptions)
- {
- if (cs.channel == channel)
- {
- channel_exist = true;
- if (!cs.connected)
- {
- cs.connected = true;
- }
- else
- is_alreadyConnect = true;
- break;
- }
- }
- if (!channel_exist)
- {
- Channel_status cs = new Channel_status();
- cs.channel = channel;
- cs.connected = true;
- subscriptions.Add(cs);
- }
- else if (is_alreadyConnect)
- {
- error_cb("Already Connected");
- return;
- }
-
- }
- else
- {
- // New Channel
- Channel_status cs = new Channel_status();
- cs.channel = channel;
- cs.connected = true;
- subscriptions = new List<Channel_status>();
- subscriptions.Add(cs);
- }
-
- bool is_reconnected = false;
- // Begin Recusive Subscribe
- while (true)
- {
- try
- {
- // Build URL
- List<string> url = new List<string>();
- url.Add("subscribe");
- url.Add(this.SUBSCRIBE_KEY);
- url.Add(channel);
- url.Add("0");
- url.Add(timetoken.ToString());
-
- // Stop Connection?
- is_disconnect = false;
- foreach (Channel_status cs in subscriptions)
- {
- if (cs.channel == channel)
- {
- if (!cs.connected)
- {
- disconnect_cb("Disconnected to channel : " + channel);
- is_disconnect = true;
- break;
- }
- }
- }
- if (is_disconnect)
- return;
-
- // Wait for Message
- List<object> response = _request(url);
-
- // Stop Connection?
- foreach (Channel_status cs in subscriptions)
- {
- if (cs.channel == channel)
- {
- if (!cs.connected)
- {
- disconnect_cb("Disconnected to channel : " + channel);
- is_disconnect = true;
- break;
- }
- }
- }
- if (is_disconnect)
- return;
- // Problem?
- if (response == null || response[1].ToString() == "0")
- {
-
- for (int i = 0; i < subscriptions.Count(); i++)
- {
- Channel_status cs = subscriptions[i];
- if (cs.channel == channel)
- {
- subscriptions.RemoveAt(i);
- disconnect_cb("Disconnected to channel : " + channel);
- }
- }
-
- // Ensure Connected (Call Time Function)
- while (true)
- {
- string time_token = Time().ToString();
- if (time_token == "0")
- {
- // Reconnect Callback
- reconnect_cb("Reconnecting to channel : " + channel);
- Thread.Sleep(5000);
- }
- else
- {
- is_reconnected = true;
- break;
- }
- }
- if (is_reconnected)
- {
- break;
- }
- }
- else
- {
- foreach (Channel_status cs in subscriptions)
- {
- if (cs.channel == channel)
- {
- // Connect Callback
- if (!cs.first)
- {
- cs.first = true;
- connect_cb("Connected to channel : " + channel);
- break;
- }
- }
- }
- }
- // Update TimeToken
- if (response[1].ToString().Length > 0)
- timetoken = (object)response[1];
-
- // Run user Callback and Reconnect if user permits.
- object message = "";
- foreach (object msg in (object[])response[0])
- {
- if (this.CIPHER_KEY.Length > 0)
- {
- if (msg.GetType() == typeof(string))
- {
- message = pc.decrypt(msg.ToString());
- }
- else if (msg.GetType() == typeof(object[]))
- {
- message = pc.decrypt((object[])msg);
- }
- else if (msg.GetType() == typeof(Dictionary<string, object>))
- {
- Dictionary<string, object> dict = (Dictionary<string, object>)msg;
- message = pc.decrypt(dict);
- }
- }
- else
- {
- if (msg.GetType() == typeof(object[]))
- {
- object[] obj = (object[])msg;
- JArray jArr = new JArray();
- for (int i = 0; i < obj.Count(); i++)
- {
- jArr.Add(obj[i]);
- }
- message = jArr;
- }
- else if (msg.GetType() == typeof(Dictionary<string, object>))
- {
- message = extractObject((Dictionary<string, object>)msg);
- }
- else
- {
- message = msg;
- }
- }
- if (!callback(message)) return;
- }
- }
- catch
- {
- System.Threading.Thread.Sleep(1000);
- }
- }
- if (is_reconnected)
- {
- // Reconnect Callback
- args["channel"] = channel;
- args["callback"] = callback;
- args["timestamp"] = timetoken;
- this._subscribe(args);
- }
- }
-
- /**
- * Request URL
- *
- * @param List<string> request of url directories.
- * @return List<object> from JSON response.
- */
- private List<object> _request(List<string> url_components)
- {
- try
- {
-
- string temp = null;
- int count = 0;
- byte[] buf = new byte[8192];
- StringBuilder url = new StringBuilder();
- StringBuilder sb = new StringBuilder();
-
- JavaScriptSerializer serializer = new JavaScriptSerializer();
-
- // Add Origin To The Request
- url.Append(this.ORIGIN);
-
- // Generate URL with UTF-8 Encoding
- foreach (string url_bit in url_components)
- {
- url.Append("/");
- url.Append(_encodeURIcomponent(url_bit));
- }
- // Create Request
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url.ToString());
-
- // Set Timeout
- request.Timeout = 310000;
- request.ReadWriteTimeout = 310000;
-
- request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip");
- request.Headers.Add("V", "3.1");
- request.UserAgent = "C#-Mono";
-
- webRequestDone.Reset();
- IAsyncResult asyncResult = request.BeginGetResponse(new AsyncCallback(requestCallBack), null);
- webRequestDone.WaitOne();
- if (abort)
- {
- return new List<object>();
- }
-
- // Receive Response
- HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asyncResult);
-
- // Read
- using (Stream stream = response.GetResponseStream())
- {
- Stream resStream = stream;
- if (response.ContentEncoding.ToLower().Contains("gzip"))
- {
- resStream = new GZipStream(stream, CompressionMode.Decompress);
- }
- else
- {
- resStream = stream;
- }
- do
- {
- count = resStream.Read(buf, 0, buf.Length);
- if (count != 0)
- {
- temp = Encoding.UTF8.GetString(buf, 0, count);
- sb.Append(temp);
- }
- } while (count > 0);
- }
-
- // Parse Response
- string message = sb.ToString();
-
- return serializer.Deserialize<List<object>>(message);
- }
- catch (Exception ex)
- {
- List<object> error = new List<object>();
- if (url_components[0] == "time")
- {
- error.Add("0");
- }
- else if (url_components[0] == "history")
- {
- error.Add("Error: Failed JSONP HTTP Request.");
- }
- else if (url_components[0] == "publish")
- {
- error.Add("0");
- error.Add("Error: Failed JSONP HTTP Request.");
- }
- else if (url_components[0] == "subscribe")
- {
- error.Add("0");
- error.Add("0");
- }
- return error;
- }
- }
-
- private void requestCallBack(IAsyncResult result)
- {
- // release thread block
- webRequestDone.Set();
- }
-
- public void Abort()
- {
- abort = true;
- webRequestDone.Set();
- }
-
- /**
- * Time
- *
- * Timestamp from PubNub Cloud.
- *
- * @return object timestamp.
- */
- public object Time()
- {
- List<string> url = new List<string>();
-
- url.Add("time");
- url.Add("0");
-
- List<object> response = _request(url);
- return response[0];
- }
-
- /**
- * UUID
- * @return string unique identifier
- */
- public string UUID()
- {
- return Guid.NewGuid().ToString();
- }
-
- /**
- * History
- *
- * Load history from a channel.
- *
- * @param Dictionary<string, string> args
- * args is channel name and int limit history count response.
- * @return List<object> of history.
- */
- public List<object> History(Dictionary<string, string> args)
- {
- string channel = args["channel"];
- int limit = Convert.ToInt32(args["limit"]);
- List<string> url = new List<string>();
-
- url.Add("history");
- url.Add(this.SUBSCRIBE_KEY);
- url.Add(channel);
- url.Add("0");
- url.Add(limit.ToString());
- if (this.CIPHER_KEY.Length > 0)
- {
- clsPubnubCrypto pc = new clsPubnubCrypto(this.CIPHER_KEY);
- return pc.decrypt(_request(url));
- }
- else
- {
- List<object> objTop = _request(url);
- List<object> result = new List<object>();
- foreach (object o in objTop)
- {
- if(o.GetType() == typeof(Dictionary<string,object>))
- {
- JObject jobj = new JObject();
- foreach (KeyValuePair<string, object> pair in (Dictionary<string, object>)o)
- {
- jobj.Add(pair.Key, pair.Value.ToString());
- }
- result.Add(jobj);
- }
- else if (o.GetType() == typeof(object[]))
- {
- object[] obj = (object[])o;
- JArray jArr = new JArray();
- for (int i = 0; i < obj.Count(); i++)
- {
- jArr.Add(obj[i]);
- }
- result.Add(jArr);
- }
- else
- {
- result.Add(o);
- }
- }
- return result;
- }
- }
-
- /**
- * Unsubscribe
- *
- * Unsubscribe/Disconnect to channel.
- *
- * @param Dictionary<String, Object> containing channel name.
- */
- public void Unsubscribe(Dictionary<String, Object> args)
- {
- String channel = args["channel"].ToString();
- foreach (Channel_status cs in subscriptions)
- {
- if (cs.channel == channel && cs.connected)
- {
- cs.connected = false;
- cs.first = false;
- break;
- }
- }
- }
-
- private string _encodeURIcomponent(string s)
- {
- StringBuilder o = new StringBuilder();
- foreach (char ch in s.ToCharArray())
- {
- if (isUnsafe(ch))
- {
- o.Append('%');
- o.Append(toHex(ch / 16));
- o.Append(toHex(ch % 16));
- }
- else o.Append(ch);
- }
- return o.ToString();
- }
-
- private char toHex(int ch)
- {
- return (char)(ch < 10 ? '0' + ch : 'A' + ch - 10);
- }
-
- private bool isUnsafe(char ch)
- {
- return " ~`!@#$%^&*()+=[]\\{}|;':\",./<>?".IndexOf(ch) >= 0;
- }
-
- private static string getHMACSHA256(string text)
- {
- HMACSHA256 sha256 = new HMACSHA256();
- byte[] data = Encoding.Default.GetBytes(text);
- byte[] hash = sha256.ComputeHash(data);
- string hexaHash = "";
- foreach (byte b in hash) hexaHash += String.Format("{0:x2}", b);
- return hexaHash;
- }
- private JObject extractObject(Dictionary<string, object> msg)
- {
- JObject jobj = new JObject();
- foreach (KeyValuePair<string, object> pair in (Dictionary<string, object>)msg)
- {
- if (pair.Value.GetType() == typeof(Dictionary<string, object>))
- {
- JObject tempObj = extractObject((Dictionary<string, object>)pair.Value);
- jobj.Add(pair.Key, tempObj);
- }
- else
- {
- jobj.Add(pair.Key, pair.Value.ToString());
- }
- }
- return jobj;
- }
- private bool doNothing(object result)
- {
- // do nothing
- return false;
- }
- }
-}
-
View
157 csharp-mono/src/PubnubCrypto.cs
@@ -1,157 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Security.Cryptography;
-using Newtonsoft.Json.Linq;
-
-namespace PubnubCrypto
-{
- public class clsPubnubCrypto
- {
- private string CIPHER_KEY = "";
- public clsPubnubCrypto(string cipher_key)
- {
- this.CIPHER_KEY = cipher_key;
- }
- // Basic function for encrypt or decrypt a string
- // for encrypt type=true
- // for decrypt type=false
- public string EncryptOrDecrypt(bool type,string plainStr)
- {
- RijndaelManaged aesEncryption = new RijndaelManaged();
- aesEncryption.KeySize = 256;
- aesEncryption.BlockSize = 128;
- aesEncryption.Mode = CipherMode.CBC;
- aesEncryption.Padding = PaddingMode.PKCS7;
- aesEncryption.IV = ASCIIEncoding.UTF8.GetBytes("0123456789012345");
- aesEncryption.Key = md5(this.CIPHER_KEY);
- if (type)
- {
- ICryptoTransform crypto = aesEncryption.CreateEncryptor();
- byte[] plainText = ASCIIEncoding.UTF8.GetBytes(plainStr);
- byte[] cipherText = crypto.TransformFinalBlock(plainText, 0, plainText.Length);
- return Convert.ToBase64String(cipherText);
- }
- else
- {
- ICryptoTransform decrypto = aesEncryption.CreateDecryptor();
- byte[] encryptedBytes = Convert.FromBase64CharArray(plainStr.ToCharArray(), 0, plainStr.Length);
- return ASCIIEncoding.UTF8.GetString(decrypto.TransformFinalBlock(encryptedBytes, 0, encryptedBytes.Length));
- }
- }
-
- //encrypt string
- public string encrypt(string plainStr)
- {
- return EncryptOrDecrypt(true, plainStr);
- }
-
- //decrypt string
- public string decrypt(string cipherStr)
- {
- return EncryptOrDecrypt(false, cipherStr);
- }
-
- // encrypt array of objects
- public object encrypt(object[] plainArr)
- {
- object[] cipherArr = new object[plainArr.Count()];
- for (int i = 0; i < plainArr.Count(); i++)
- {
- cipherArr[i] = encrypt((string)plainArr[i]);
- }
- return cipherArr;
- }
-
- // decrypt array of objects
- public JArray decrypt(object[] cipherArr)
- {
- JArray plainArr = new JArray();
-
- for (int i = 0; i < cipherArr.Count(); i++)
- {
- if (cipherArr[i].GetType() == typeof(object[]))
- {
- plainArr.Add(decrypt((List<object>)cipherArr[i]));
- }
- else if (cipherArr[i].GetType() == typeof(string))
- {
- plainArr.Add(decrypt((string)cipherArr[i]));
- }
- else
- {
- plainArr.Add(decrypt((Dictionary<string, object>)cipherArr[i]));
- }
- }
- return plainArr;
- }
-
- // decrypt list of objects for history function
- public List<object> decrypt(List<object> cipherArr)
- {
- List<object> lstObj = new List<object>();
- foreach (object o in cipherArr)
- {
- if (o.GetType() == typeof(object[]))
- {
- lstObj.Add(decrypt((object[])o));
- }
- else if (o.GetType() == typeof(string))
- {
- lstObj.Add(decrypt(o.ToString()));
- }
- else
- {
- lstObj.Add(decrypt((Dictionary<string,object>)o));
- }
- }
- return lstObj;
- }
-
- // encrypt object with key value pair <string,object> format
- public Dictionary<string, object> encrypt(Dictionary<string, object> plainObj)
- {
- Dictionary<string, object> newDict = new Dictionary<string, object>();
- foreach (KeyValuePair<string, object> pair in plainObj)
- {
- if (pair.Value.GetType() == typeof(string))
- {
- newDict.Add(pair.Key, encrypt(pair.Value.ToString()));
- }
- else
- {
- newDict.Add(pair.Key, encrypt((Dictionary<string, object>)pair.Value));
- }
- }
- return newDict;
- }
-
- // decrypt object with key value pair <string,object> format
- public JObject decrypt(Dictionary<string, object> cipherObj)
- {
- JObject objPlain = new JObject();
-
- foreach (KeyValuePair<string, object> pair in cipherObj)
- {
- if (pair.Value.GetType() == typeof(string))
- {
- objPlain.Add(pair.Key, decrypt(pair.Value.ToString()));
- }
- else
- {
- objPlain.Add(pair.Key, decrypt((Dictionary<string, object>)pair.Value));
- }
- }
- return objPlain;
- }
-
- //md5 used for AES encryption key
- private static byte[] md5(string cipher_key)
- {
- MD5 obj = new MD5CryptoServiceProvider();
- byte[] data = Encoding.Default.GetBytes(cipher_key);
- return obj.ComputeHash(data);
- }
- }
-}
View
372 csharp-mono/unit-test.cs
@@ -1,372 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using Pubnub;
-
-namespace csharp_demo