Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Websocket Essentials: Building apps with HTML5 websockets

You're reading from   Websocket Essentials: Building apps with HTML5 websockets Build your own real-time web applications using HTML5 WebSockets

Arrow left icon
Product type Paperback
Published in May 2015
Publisher
ISBN-13 9781784396756
Length 110 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Varun Chopra Varun Chopra
Author Profile Icon Varun Chopra
Varun Chopra
Arrow right icon
View More author details
Toc

Where does WebSockets fit?

As we have seen some examples of web applications, now the question here is where does WebSockets fit in these applications or any web application? Let us first understand something about application behavior; let us take an example of Gmail, which is basically a mailing client. The work of a mailing client is to fetch mails and display them. This sounds simple, but the problem arises when someone sends you a mail and you want that mail to be displayed right away. To implement such a functionality there are different ways, such as polling and long-polling, which are not efficient. So WebSockets solves the problem here by providing a server push facility. WebSockets provides functionality to push from both the client and server side, which makes it stand out.

WebSockets comes with some good features and great benefits over other methods of communication. Some of the features and benefits of WebSockets are:

  • Full-duplex communication
  • Low bandwidth consumption
  • Security
  • Low latency
  • Works over Transmission Control Protocol (TCP) (although it needs HTTP for initial handshake)
  • Supported by almost all the web browsers and web servers including mobile browsers

We can treat WebSockets as a feature which enhances the experience of web applications. And with HTML5-enhanced features, we can create a dynamic and real-time application.

You have been reading a chapter from
Websocket Essentials: Building apps with HTML5 websockets
Published in: May 2015
Publisher:
ISBN-13: 9781784396756
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime