Last active
August 29, 2015 14:06
-
-
Save stephenlb/13bfd88284ec1f4d59f5 to your computer and use it in GitHub Desktop.
The Subscribe<string>() method is being used to receive poll answers in realtime via an automatically negotiated protocol like WebSockets, HTTP Streaming, HTTP Long-polling, TCP Streaming and more with automatic recovery of dropped messages. We've made it easy for you to get started by providing this easy-to-use SDK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Subscribe To Vote Submissions | |
| pubnub.Subscribe<string>( | |
| pubnubChannel, | |
| DisplayReturnMessage, | |
| DisplaySubscribeConnectStatusMessage, | |
| DisplayErrorMessage | |
| ); | |
| // Callback method Receive Votes in JSON string format | |
| static void DisplayReturnMessage(string result) | |
| { | |
| Console.WriteLine("VOTE RECEIVED!"); | |
| Console.WriteLine(result); | |
| Console.WriteLine(); | |
| } | |
| // Callback method to provide the connect status of Subscribe call | |
| static void DisplaySubscribeConnectStatusMessage(string result) | |
| { | |
| Console.WriteLine("SUBSCRIBE CONNECT CALLBACK:"); | |
| Console.WriteLine(result); | |
| Console.WriteLine(); | |
| } | |
| // Callback method for error messages | |
| static void DisplayErrorMessage(PubnubClientError result) | |
| { | |
| Console.WriteLine(); | |
| Console.WriteLine(result.Description); | |
| Console.WriteLine(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment