building a service layer using asp.net web...
TRANSCRIPT
SignalR Incredibly simple real-time web for .NET
First Half Second Half
(01) What’s New in ASP.NET 4.5 (60 mins) ** MEAL BREAK **
(02) Building and Deploying Websites
with ASP.NET MVC 4 (60 mins)
(06) Building Social Web Applications
with ASP.NET (30 mins)
(03) Creating HTML5 Applications with
jQuery (60 mins)
(07) Building for the Mobile Web (60
mins)
(04) Building a Service Layer with
ASP.NET Web API (30 mins)
(08) Real-time Communications with
SignalR (45 mins)
(05) Leveraging your ASP.NET
Development Skills to Build Office
Apps (15 mins)
(09) Taking advantage of Windows Azure
services (30 mins)
Microsoft /web ®
Microsoft /web ®
Long
Polling
Forever
Frames
Server
Sent
Events
Web
Sockets
Microsoft /web ®
Client
Browser
Web
Server HTTP GET – Got data? HTTP GET – Got data? HTTP GET – Got data? HTTP GET – Got data? HTTP GET – Got data? HTTP GET – Got data? HTTP GET – Got data? HTTP GET – Got data? HTTP GET – Got data? HTTP GET – Got data? HTTP GET – Got data? HTTP GET – Got data?
Client
Browser
Web
Server HTTP GET – You do realtime?
Sure, I’m a new server. I love realtime.
Let’s go!
Awesome
var hub = $.connection.chat;
hub.addMessage = function (msg){
$("#msgs").append("<li>" + msg + "</li>");
};
$.connection.hub.start().done(function () {
$("#send").click(function () {
hub.sendMessage($("#msg").val());
});
});
public class Chat : Hub {
public void SendMessage(string m) {
Clients.addMessage(m);
}
}
JavaScript Client
C# Server
var hubConnection = new HubConnection("http://server"); dynamic chat = hubConnection.CreateProxy("chat"); chat.On("addMessage", m => messages.Add(m)); hubConnection.Start().Wait(); send.Click += (s, e) => chat.send(message.Text);
public class Chat : Hub {
public void SendMessage(string m) {
Clients.addMessage(m);
}
}
.NET Client:
Windows Phone
Silverlight
C# Server