Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Web Sockets

No description
by

rythmal jayendranath

on 24 June 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Web Sockets

Web Sockets
bi-directional
full-duplex
communication channel
Peek at the code...
In Java Script
var ws =
new WebSocket('ws://127.0.0.1:8080/async');
Event handlers for
onopen
onmessage
onclose
onerror
Fallbacks
Flash Sockets
high connection setup time
port 843 (policy file)
needs flash plugin
Comet
Comparison
Web Socket

Vs



Polling

Use case A: 1,000 clients polling every second:
Use case B: 10,000
Use case C:100,000
Evolution of web Development
Not just static web pages
Dynamic applications
Run-time components
Asynchronous
Communication
Walk in the Tech lane..
XMLHTTP-Microsoft
XMLHttpRequest (XHR) -Mozilla
AJAX
Reverse AJAX
AJAX
Reverse AJAX
Asynchronous JavaScript and XML
Allows a script to make an HTTP request to a website behind the scenes,
without the need for a page reload
to send data from the
server to the client
simulated to issue an Ajax request, in specific ways, so the server can send events to the client
as quickly as possible
ReverseAJAX
Polling
Comet
HTTP Streaming
HTTP LongPolling
HTTP Polling
JSON Polling
PiggyBackPolling
Forever iFrame
MultiPart XMLHttp Request
Script Tags
XMLHttp Request
provides real-time message delivery within the bounds of the
poll interval
A request is sent to the server and
kept alive for a long time
, until a time-out or a server event occurs
When the request is completed,
another long-lived Ajax request is sent
to wait for other server events
client
always has a communication link
open to the server
Upstream requests can be issued by the browser to server are made over
an additional HTTP connection
directional communications over
two HTTP connections

push
” communications by maintaining a
persistent connection
or
long-lived HTTP request
between the server and the browser
One persistent connection
is opened
There will only be a long-lived request since each event arriving on the server side is
sent through the same connection
Bandwidth and resources lost
Websocket Implemetations
Enable real-time push on
Java based web applications
Solutions
Use an externalized systems –pusher
Commercial solution –
Kazzing, Diffusion
Container specific API





Open source frameworks
Jetty continuation
Tomcats Comet Processor
Grizzly Comet handler
Netty webockets
Atmosphere
CometD
Jwebsockets
Why Atmosphere ?
all async technologies
Bundle with variety of modules and plugins – clustering plugins
Support
all web containers
Atmosphere Support Servers
Atmosphere Support Browsers
Atmosphere Architecture
WebSockets
Sasinda premarathna
Rythmal Jayendranath
Tharindu Gunasekara

Whats next..?
WebSockets
Thank You!
Full transcript