You must Sign In to post a response.
  • Category: Visual Studio

    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
  • #768048
    hi

    I can send you website name in this website all the information and videos ,samples are their as well as
    some code in this website you can visit this website .

    www.asp.net/.../getting-started/tutorial-getting-started-with-signalr
    hope this help you.

    thank you


Sign In to post your comments