1

I can successfully call testFunc() on my server. But the Invoke simply never gets to my testFuncCallback() function. Since I can call the server, the connection appears to be fine. Any idea what's going on?

BACKEND:

[HubName("testHub")]
public class testHub: Hub
{
    public void testFunc()
    {
        Clients.Caller.Invoke("testFuncCallback");
    }
}

JS:

$scope.lTestHub = $scope.$parent.signalrConnection.testHub;
$scope.lTestHub.on('testFuncCallback', function () {
    alert("jo");
});
$scope.lTestHub.server.testFunc();

1 Answer 1

1

Change the line

$scope.lTestHub.on('testFuncCallback', function () {

to

$scope.lTestHub.client('testFuncCallback', function () {

That should do it.

See simple example here: http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.