How to call SignalR C # methods
It depends on the protocol, but allows you to claim that your browser (and server) supports the webSocket protocol:
You are sending (via javascript) a message:
var socket = new WebSocket("ws://..."); // the required token on the server side is present here as a parameter (+ params)
The server can (fw4.5) process this message and reflection , dynamic - it calls the method.
However, there is a catch (by design) that it performs - asynchronously :
So this code will not work:
var a=1; var b=2; var c=myHBub.server.add(a,b); alert(c)
So far this one will work:
var a=1; var b=2; myHBub.server.add(a,b).done(function (result){alert(result);});
How does this happen and how?
I executed the Js client method named "Join":
and here is the main performer:
http://i.stack.imgur.com/jf9Fz.jpg

source share