SignalR: POST Long Poll
Scott posted recently about “Asynchronous scalable web applications with real-time persistent long-running connections with SignalR”. Running the demo up in Chrome shows that as expected the magic is in POST long poll:
Request URL:http://chatapp.apphb.com/signalr
Request Headers
Accept:application/json, text/javascript, */*; q=0.01
Content-Type:application/x-www-form-urlencoded
Origin:http://chatapp.apphb.com
Referer:http://chatapp.apphb.com/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.218 Safari/535.1
X-Requested-With:XMLHttpRequest
Form Data
clientId:0b3a26da-3032-4a39-9cfb-15f37fd9e186
messageId:1240
data:[{"name":"SignalR.Samples.Hubs.Chat.Chat","methods":["joinRoom","markInactive","updateActivity","showRooms","addMessageContent","addMessage","addUser","changeUserName","showCommands","sendMeMessage","sendPrivateMessage","leave"]}]
transport:longPolling
groups:SignalR.Samples.Hubs.Chat.Chat.one
Scott also mentions that “In the future things like WebSockets will be another way to solve this problem when it’s baked.” Today, SignalR is just another way to PUSH data to the browser, similar to my-channels Nirvana, and all the other PUSH servers on the market.
Advertisement

The claim that SIgnalR is only using long polling seems to be partly incorrect, there is client side support for WebSockets.
Checkout the client side source at https://github.com/SignalR/SignalR/blob/master/SignalR/Scripts/jquery.signalR.js#L211