Connected Web Systems

Post on 10-May-2015

311 views 0 download

Tags:

description

Connecting Web Systems by Damir Dobric. Presentation from the Advanced Developers Conference

Transcript of Connected Web Systems

Connecting Web Systems

by Damir Dobric

Lap around new technologies which might change the

web soon.

AGENDA

Limits of Web

Data Streaming in Web

Web Sockets

Signal R

RequestResponse

Polling

Long Polling

Streaming

Persistent Connections

Connecting Patterns

ASP.NET 4.5

Long Responses

Async in Backend

HttpTaskAsync

Handler

Stream Push to Browser

Stream Push to any app

HTML5 Spec.

IIS8-WebSocket Support

JS WebSocketClient

ASP.NET Web Socket Server

WCF WebSocket

ServiceWCF

WebSocketClient

ForeverFrames

SentServerEvents

JS Client

.NET Server

Persistent Connections

Hubs

Limits of Web

http Request/Response

X

Connecting Patterns

http Request/Response

Xhttp Request/Response

http polling

http Request/Response

Full-Duplex

Polling Approach

while(true){var response = httpClient.SendRequest(“http://...”);

processResponse(response.Data);Thread.Sleep(T);

}

tcpClient.TimeOut = 999999..;var netStream = tcpClient.SendHttpRequest(“http://...”); while(true){ var data1 = netStream.Read(); var data2 = processData(data1); netStream.Write(data2); }}

Infrastructure Limits

Full-Duplex

XNo streaming support ?

Connection Limit ?

X

DATA STREAMING IN WEB

ASP.NET 4.5

Long Responses

Async in Backend

HttpTaskAsync

Handler

Stream Push to Browser

Stream Push to any app

o Async In Front Endo Responsive UIo Battery Life

o Async in Backendo Waiting on IOo Fan Out Awaito C/S Stream

Why Async ?

DEMO

ASP.NET 4.5

Long Responses

Async in Backend

HttpTaskAsync

Handler

Stream Push to Browser

Stream Push to any app

WEB SOCKETS

HTML5 Spec.

IIS8-WebSocket Support

JS WebSocketClient

ASP.NET Web Socket Server

WCF WebSocket

ServiceWCF

WebSocketClient

What is WebSocket?

oDriven by HTML5oFull-Duplex over TCPoBrowser native Socket connectiono IETF Spec. - HyBi 17(IE10 Win8=HyBi10)

ArchitectureEndpoints

JavaScript

WinRT.NET

Consumers

WCF netHttpDuplex

WinRT WebSocketsJavaScript

.NETConsumers

ASP.NETModule

WCFWebSocket

Hosting

DEMO

HTTP/Upgrade

ASP.NETJavaScript

WebSocketChat

WebSocketHanlder

WebSocket WCF Duplex

NetHttp

References

x

• http://developers.de/blogs/damir_dobric/archive/2011/11/26/wcf-duplex-via-websocket.aspx• http://rickgaribay.net/archive/2012/08/14/the-goods-websockets-programming-in-.

net-4.5-and-windows-azure.aspx• http://

www.devconnections.com/updates/Garibay_Build%20Speedy%20Azure%20Applications%20with%20HTML5%20and%20Web%20Sockets%20Today.pdf

• http://rickgaribay.net/archive/2012/08/14/the-goods-websockets-programming-in-.net-4.5-and-windows-azure.aspx

• http://www.paulbatum.com/2011/10/getting-to-know-systemnetwebsockets.html

SignalR

ForeverFrames

SentServerEvents

JS Client

.NET Server

Persistent Connections

Hubs

What when?

XNo streaming support ?

X

No ClientWebSocket Support ?

No Server WebSocket Support ?

Server Sent Events

• Push from a server to a browser• Part of HTML5 spec• http://dev.w3.org/html5/eventsource• Header: text/event-stream• Implemented natively in Browser• Long polling without closing connection

http://dsheiko.com/weblog/websockets-vs-sse-vs-long-polling

Forever-Frame streaming

oPush notificationsoNot based on Long-PollingoUses HTTP 1.1 chunked encodingo Internet Explorer

SignalR

o Permanent Connection support for none HTML5 browsers.o Use it when infrastructure does not support any other push technology

o Two Part Libraryo jQuery PlugIn for Cliento .NET Library for Server

o Supported Transports:o Long pollingo WebSocketso Forever Frame streamingo Server Sent events

DEMO

ForeverFrames

SentServerEvents

JS Client

.NET Server

Persistent Connections

Hubs

RECAP + Q&A

Limits of Web

Data Streaming in Web

Web Sockets

Signal R

RequestResponse

Polling

Long Polling

Streaming

Persistent Connections

Connecting Patterns

ASP.NET 4.5

Long Responses

Async in Backend

HttpTaskAsync

Handler

Stream Push to Browser

Stream Push to any app

HTML5 Spec.

IIS8-WebSocket Support

JS WebSocketClient

ASP.NET Web Socket Server

WCF WebSocket

ServiceWCF

WebSocketClient

ForeverFrames

SentServerEvents

JS Client

.NET Server

Persistent Connections

Hubs

Thank You Damir Dobric