Unable to send more than two input values in the below signalR Client
Sub Main()Dim connection = New HubConnection("http://localhost:8080")
Dim myHub = connection.CreateHubProxy("myHub")
connection.Start().Wait()
Console.ForegroundColor = ConsoleColor.Yellow
Dim Input As String = Console.ReadLine
myHub.Invoke(Of String)("Chatter", Input) _
.ContinueWith(
Sub(task)
If task.IsFaulted Then
Console.WriteLine("Could not Invoke the server method Chatter: {0}", _
task.Exception.GetBaseException())
Else
Console.WriteLine("Success calling chatter method")
End If
End Sub)
myHub.On(Of String)("addMessage", _
Sub(param)
Console.WriteLine("Client receiving value from server: {0}", param.ToString())
End Sub)
Console.ReadLine()
End Sub
The above code gets the value from myHub.Invoke(Of String)("Chatter", Input)_
Dont know what is happening inside .continuewith block could anyone please help , but could anyone please help me to keep sending the input user value. when i replace the .continuewith block the client is not receiving the values.
and when i use the below code
Sub Main()
Dim connection = New HubConnection("http://localhost:8080")
Dim myHub = connection.CreateHubProxy("myHub")
connection.Start().Wait()
Console.ForegroundColor = ConsoleColor.Yellow
Dim Input As String = Console.ReadLine
myHub.Invoke(Of String)("Chatter", Input) _
.ContinueWith(
Sub(task)
If task.IsFaulted Then
Console.WriteLine("Could not Invoke the server method Chatter: {0}", _
task.Exception.GetBaseException())
Else
myHub.Invoke(Of String)("Chatter", Input)
Console.WriteLine("Enter a value to send to the Client. Enter 'Exit' to quit")
Input = Console.ReadLine()
Console.WriteLine("Success calling chatter method")
End If
End Sub)
myHub.On(Of String)("addMessage", _
Sub(param)
Console.WriteLine("Client receiving value from server: {0}", param.ToString())
End Sub)
Console.ReadLine()
End Sub
the value getting posted n number of times more than 50 times