Created
November 23, 2020 19:41
-
-
Save YuriyZaletskyy/2b813ec12d8a46e46f971c3a65a7871d to your computer and use it in GitHub Desktop.
This file contains 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
var myHub = connection.CreateHubProxy("PushNotificationsHub"); | |
connection.Start().ContinueWith(task => | |
{ | |
try | |
{ | |
if (task.IsFaulted) | |
{ | |
MessageBox.Show("There was an error during open of the connection: " + | |
task.Exception.GetBaseException()); | |
} | |
else | |
{ | |
myHub.Invoke<string>("Subscribe", "TestNotification").Wait(); | |
} | |
} | |
catch (Exception ex) | |
{ | |
MessageBox.Show("Error: " + ex.Message.ToString()); | |
} | |
}).Wait(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment