I tried using the same while loop to achieve the same but its becoming a infinite loop
Sub Main()
Dim connection = New HubConnection("http://localhost:8080")
Dim myHub = connection.CreateHubProxy("myHub")
connection.Start().Wait()
Console.ForegroundColor = ConsoleColor.Yellow
myHub.Invoke(Of String)("Chatter", Console.ReadLine) _
.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
Could you point to me a way to keep sending the input values to the server ?
**Changes made **
Dim param As String = Console.ReadLine()
While param <> "Exit"
Console.WriteLine("Server Sending Value to Client X: {0}", param)
myHub.On(Of String)("addMessage", _
'Sub(param)
Console.WriteLine("Client receiving value from server: {0}", param.ToString())
'End Sub)
Console.WriteLine("Enter a value to send to the Client. Enter 'Exit' to quit")
param = Console.ReadLine()
End While
Console.ReadLine()
but in this line : myHub.On(Of String)("addMessage", _ ITS THROWING ERROR "EXPRESSION EXPECTED"