Showing posts with label Sockets. Show all posts
Showing posts with label Sockets. Show all posts

Tuesday, June 12, 2012

Html5 Web Sockets Example

Html5 Web Sockets will singular handedly revolutionize web technologies as we know it. The purpose of this post is to account for what techniques have been used to simulate server push until now, define Html5 web sockets, and then give an example of how to use it in your Html5 application.

What is polling?
Until now, the web has been one directional. In other words, web pages could only send a ask to a web server, and not the other way around. Once Ajax came along in 2005, web developers swiftly adopted techniques to simulate a ask from server to client known as polling. There are two types of polling, short polling and long polling.

Sockets & Socket Sets Hand Tools

Short polling is implemented by development a ask to the web server every few seconds or so to see if data has changed. If it has, the web server will respond with the new data. Otherwise, it will respond with a blank message. The drawback to this technique, however, is both a surplus is server requests and an overhead in Cpu usage on the web server to permanently check if an update to the data has been made.

Html5 Web Sockets Example

#1 Sale Now Belkin Conserve Socket F7C009q Energy-Saving Outlet


Belkin Conserve Socket F7C009q Energy-Saving Outlet Feature

  • Easy to set timer; 30 minutes, 3 hours or 6 hours. Continuous Duty Electrical Rating: 120V~/15A/60Hz/1800W. Operating Power Consumption: 0.18W
  • Saves energy; completely cuts power after timer expires
  • Makes your home safer by automatically shutting off space heaters, curling irons, coffee makers etc.
  • Can be used throughout home for multiple devices including fans, cell phone chargers, lights, kitchen appliances, electric toothbrushes etc.
  • Ships in Certified Frustration-Free Packaging

Belkin Conserve Socket F7C009q Energy-Saving Outlet Overview

Belkin Conserve Socket - Energy Saving Outlet (F7C009q).Makes your home safer by automatically shutting off space heaters, curling irons, coffee makers.Can be used throughout home for multiple devices including fans, cell phone chargers, lights, kitchen appliances, electric toothbrushes.

Available at Amazon Check Price Now!

Related Products

Customer Reviews




*** Product Information and Prices Stored: Jun 12, 2012 11:03:47

Long polling is implemented by development a singular ask to the web server and holding the connection open until the data has changed, at which point the web server sends back a response. The drawback to this technique, like short polling, is that the web server still has to check if the data has changed every few seconds or so, creating an overhead in Cpu usage.

What's an Html5 web socket?
This is where Html5 web sockets come in. Html5 will be the first Html specification to preserve client side web sockets. In other words, when data changes on the web server, the web server can send a ask to client, eliminating the need for polling.

Html5 web socket example
Step 1: generate a WebSocket with a valid Url

Create a new WebSocket connection to WebSocket server at finance.example.com.

var stockTickerWebSocket = new WebSocket("ws://finance.example.com");

Note that a ws:// and wss:// prefix indicate a WebSocket and a derive WebSocket connection respectively. The default port for WebSockets is 81 and the default port for derive WebSocket is 815.

Step 2: Attach JavaScript Callback Functions

Associate event listeners to deal with each phase of the connection life cycle.

stockTickerWebSocket.onopen = function(evt)

alert("Stock Ticker connection open...");
;
stockTickerWebSocket.onmessage = function(evt)
alert( "Received Ticker Update: " + evt.data);
;

stockTickerWebSocket.onclose = function(evt)

alert("Connection closed.");
;

Step 3: Send and Receive Data

To send a message to the server, naturally call the postMessage recipe on the webocket with the article you wish to send to the server.

stockTickerWebSocket.postMessage("Buy: Goog,100@200.25″);

This will send the Buy message to the server. Any message advent from the server will be delivered to the onmessage callback registered in step #2.

Step 4: Disconnect When Done

When completed, call the disconnect() recipe to close the WebSocket connection.

stockTickerWebSocket.disconnect();

As demonstrated in the example above, there are no Http requests made to the server from the client side to retrieve data, instead the data was pushed to the client from the server - when it becomes available.

When a new WebSocket connection is established the browser opens an Http connection to the server first and then negotiates with the server to upgrade the connection to a dedicated and persistent WebSocket connection. This process automatically sets up a tunnel through to the server - passing through all network agents (proxies, routers, and firewalls) in the middle (very much like Https establishing a secure, endtoend connection), solving numerous issues that the assorted Comet programming techniques encountered. Once established the WebSocket is a fullduplex channel between the client and the server.

Example provided by http://www.indicthreads.com

Html5 Web Sockets Example

My Links : Band Saws Woodworking Tools home improvement Wrenches Hand Tools Multitools Hand Tools Arc Welding Equipment Power Tools

Monday, June 11, 2012

Network+ Exam Tutorial: Ports, Port Numbers, and Sockets

If there's one thing that can be a bit confusing to many Network+ certification exam candidates, it's the conception of ports and sockets. Well, it was confusing to me when I got started with computer certifications! Let's take a look at ports and sockets, and why we need them in the first place.

Past Network+ exam tutorials have focused on how two Pcs start communicating, but what we've got to keep in mind is that host Pcs may and probably will have any distinct kinds of communications going on at the same time. A singular Pc may be sending email, receiving a Telnet request, and accessing the Internet at the same time. These conversations have to kept separate.. But how?

Sockets & Socket Sets Hand Tools

Through the use of ports, that's how. Each inherent type of conversation a host can have is preassigned a port number, and these port numbers allow distinct types of communications to take place over the same physical cable by holding them logically separated.

Network+ Exam Tutorial: Ports, Port Numbers, and Sockets

#1 Sale Now Stanley 92-809 MaxDrive 60-Piece 1/4 and 3/8-inch Standard and Metric Socket Set With Case


Stanley 92-809 MaxDrive 60-Piece 1/4 and 3/8-inch Standard and Metric Socket Set With Case Feature

  • 60-piece socket set meets or exceeds ANSI standards for sockets and ratchets
  • Max-drive design provides 15 percent more torque
  • Constructed of high-alloy steel and heat treated for increased performance
  • Stored in durable blow-molded case
  • Includes limited lifetime warranty

Stanley 92-809 MaxDrive 60-Piece 1/4 and 3/8-inch Standard and Metric Socket Set With Case Overview

The Stanley 92-809 Socket Set includes 60 tools that are designed to meet or exceed ANSI standards for sockets and ratchets. This set comes with a limited lifetime warranty.

What's in the Box
24 1/4-inch sockets, 19 3/8-inch sockets, 1 3/8-inch pear head ratchet arm, 1 1/4-inch socket driver handle, 1 3/8- to 1/4-inch adapter, 1 3/8-inch extension bar, 1 1/4-inch drive specialty bit holder, 10 specialty bits, blow molded case, and color graphic labels.



Versatile, durable, and designed to accomplish tasks efficiently.


Designed to meet high standards for quality and performance. See a video for Stanley Tool Sets.

About Stanley Sockets
Stanley sockets feature the proprietary Max-Drive design, a unique radius corner design which provides 15 percent more torque, making it easy to tighten fasteners and simplifies the turning of rounded corners. This technology helps reduce fastener wear without contact on the outer 5 percent of the fastener, so fasteners last longer. This helps reduce slipping on frozen or rusted fasteners. Stanley sockets are manufactured worldwide with high alloy steel and heat treated for performance.

Available at Amazon Check Price Now!

Related Products

Customer Reviews




*** Product Information and Prices Stored: Jun 11, 2012 21:01:04

Let's go back to that Pc we were talking about. If the Pc is using Smtp for email communications, it will use port 25. At the same time, the host will be using port 23 for Telnet and port 80 to entrance the web via Http. The same physical cable is in use, but the communications are kept logically isolate by use of port numbers.

A socket is simply the host's Ip address followed by a colon and the port estimate in use. If the previously mentioned host had an Ip address of 10.1.1.1, the socket estimate for Smtp would be 10.1.1.1:25, 10.1.1.1:23 for Telnet, and 10.1.1.1:80 for Http.

The range of port numbers is quite large - 0 straight through 65,535 - and the 0 - 1023 range is known as the customary port numbers. Don't worry, you don't have to memorize all of them! As you gain more and more taste with networks, you'll be surprised how many of these you remember without even mental about it. In the meantime, for both your Network+ and Ccna exams as well as working with real-world networks, it's a good idea to know this list of often-used ports.

File exchange Protocol uses both ports 20 and 21.

Telnet uses port 23.

Simple Mail exchange Protocol (Smtp) uses port 25.

Domain Name assistance (Dns) uses port 53.

HyperText exchange Protocol (Http) uses port 80, while the obtain version of Http, Https, uses port 443.

Believe me, this is just a very short beginning list of port numbers you'll need to know to pass the Network+ exam. If you're customary with these protocols, that's great - and if you're not, just look for upcoming Network+ exam tutorials!

Network+ Exam Tutorial: Ports, Port Numbers, and Sockets

My Links : Band Saws Woodworking Tools Clamps Hand Tools Knives Hand Tools