Understanding Angular 4 Websockets

Jun 05,2017 | Posted by : Michelle Esposito

Some may be surprised to learn that websockets are defined as part of HTML5. Since HTML5 defines everything that a web browser needs to know about in order to implement a web browser, that does include some javascript libraries. These are actually HTML5 API’s since they are built into the browser.

Javascript in your page can call into the native built-in HTML5 API’s for things like local storage, web workers, DOM API and websockets. Some of those API’s have been around for a long time but the most recent are the HTML5 API’s.

There’s no separate or extra javascript file that you need, it’s built into the browser. You can actually work at the level of websockets rather than the level of HTTP. HTTP is a connectionless stop-and-go protocol. TCP/IP works much differently than HTTP since it’s a direct point to point.

TCP/IP is connected and remains open to allow data to be sent back and forth independently at any time. It’s binary and as a result you get much higher density and better performance. There is less overhead with this protocol so there’s lower latencies and higher bandwidth. You get full duplex conversations.

The reason that you want to drop down from HTTP and into the websockets world is to take advantage of the lower latency, higher throughput bandwidth and the ability to send and receive audio or image data. If you are interested in Angular you may also be interested in learning solidity. Learn solidity and how to develop on Ethereum.

Learn what else is possible with websockets and more in Angular 4 by taking one of our courses led by expert instructors.

View our nationwide schedule for Comprehensive Angular 4 training.

angular 4 training angular 4 websocket websockets angularjs angular 2 websocket client angular2 websocket client HTML5

Views: 5115