I am using windows From application as client and MVC as a server Now i want to send some data from windows application to MVC application using SignalR what should I do, currently i am using this code -

          var connection = new HubConnection("http://localhost:56628");
           //Make proxy to hub based on hub name on server
            var myHub = connection.CreateHubProxy("realTimeJTableDemoHub");
            //Start connection
            connection.Start();
            connection.Start().ContinueWith(task =>
            {
                if (task.IsFaulted)
                {
                    MessageBox.Show("Error");
                }
                else
                {
                    MessageBox.Show("Success");
                }

            }).Wait();

myHub.Invoke<string>("ReSend", "HELLO World").ContinueWith(task =>
            {
                if (task.IsFaulted)
                {
                    MessageBox.Show("Error");
                }
                else
                {
                    MessageBox.Show("Successfully Connected");
                }
            });

Related posts

Recent Viewed