Since the beginning of the Web, what you see in your browser window depended on what you clicked on on or entered. It’s all been end-user driven – although the choices of what they can click on are predefined by the Web site designer. This is what they call ‘pull’ technology because the information on the screen is pulled from a Web server. But there are times when it would be useful to have push technology – particularly to mobile phones.
Push technology could keep you informed about the latest football scores and results. It could give you the latest news from international sport events. It could give you stock prices, and highlight rising or plummeting shares. It could tell you when a Web site you follow is updated. There are lots of potential reasons for organizations to want to use push technology.
You may have thought that AJAX (Asynchronous JavaScript and XML) made the Web seem a bit more responsive – but it was still client initiated. Another technique that’s sometimes used is called ‘long-polling’. A client requests information from the server, but if the server does not have anything to send when the poll is received, it holds the request open and waits for response information to become available (instead of sending an empty response). The server then sends an HTTP/S response. Of course, each HTTP request means that headers and cookie data are transferred to the server. If large amount of data are sent, this can lead to increased latency.
Another technique is called streaming, which uses a persistent HTTP connection between the server and client. The browser remains in ‘loading’ mode after the initial page load. Then, from time-to-time, the server sends small bits of JavaScript to update the page. There can be problems with browsers timing out with this technique.
What if it were possible to have a full-duplex communication channel that operates through a single socket over the Web? That’s where HTML5 WebSockets comes in – it makes it possible to have real-time, full-duplex, bidirectional, event-driven Web applications.
How it works is that during their initial handshake, the client and server upgrade from the standard HTTP protocol to the WebSockets protocol. Once established, WebSocket data frames (text and binary frames) can be sent in both directions between the client and the server in full-duplex mode. The data has a two-byte frame. Text frames start with a 0x00 byte, end with a 0xFF byte, and contain UTF-8 data in between. They also use a terminator. Binary frames use a length prefix. There is no polling involved.
Enthusiasts say that WebSockets can make your applications run faster, be more efficient, and more scalable. WebSockets started life as a feature of the HTML5 spec known as TCPConnection. Currently, WebSockets are specified in two places: the Web Sockets API is maintained by HTML5 editor Ian Hickson, while the Web Socket protocol is edited by Ian Fette.
So, if it’s so great, why isn’t it everywhere, why don’t we come across it being used all over the place? Well, it works with Firefox; it works with Chrome; it works with Safari and Opera; and it works with Internet Explorer 10 and above. And that’s pretty much the hold up. Many organizations are still running older version of Explorer – Version 8 in many cases. And figures suggest that just under a quarter of users use Internet Explorer (http://en.wikipedia.org/wiki/Usage_share_of_web_browsers#Wikimedia_.28April_2009_to_April_2013.29), so why would any company cut itself off from a quarter of its potential clients?
The very fact that there have been workarounds, shows that there is a business need for push technology. WebSockets provides a solution to the problem of how to implement push technology. The fly-in-ointment at the moment is that a popular browser (from a well-known manufacturer of games consoles) doesn’t support it. As more-and-more companies upgrade to IE10 and above, the likelihood is that we will see much more push technology in use, and WebSockets will be the way to implement it.
Showing posts with label HTML5. Show all posts
Showing posts with label HTML5. Show all posts
Sunday, 1 December 2013
Push technology
Labels:
AJAX,
blog,
Eddolls,
HTML5,
Ian Fette,
Ian Hickson,
long-polling,
pull,
push,
streaming,
TCPConnection,
Web,
WebSockets
Sunday, 31 October 2010
Android rules OK!
There’s nothing I hate more than being cornered at a party (or conference or anything else) by an iPhone user who wants to explain to me in excruciating detail how clever his phone is. I tend to liken these iPhone worshipers to members of the Young Communist League in the 1950s, who would not just happily forgive anything said or done in Moscow but describe it as a good thing. There’s just no reasoning with them, and they’re very very boring! But now, I have a secret weapon. I have an android phone. And I can bore them back by showing them my apps – until they go away like Mormons on a Sunday afternoon and knock on the door of the next house down.
I’ve recently acquired a Samsung Galaxy Apollo, which is a slightly cut-down version of their top-of-the-range Galaxy S. It seems to do everything I want and, of course, being an android phone, it has access to the thousands of free apps.
Now, it’s confession time, I think the iPhone is better at photography than my phone. I don’t have a flash with the camera, I can’t move the focus point round on the screen, and it doesn’t create composite photos to allow for lighting, so what would have been a shaded area becomes clearly visible. I’m also waiting for Android 2.2 (FroYo), which will offer more facilities.
But, and for me this was a deal breaker, it doesn’t need iTunes. Oh how restrictive iTunes is to its users! Now, again, I have listened to hours (or perhaps it just seemed that way) of explanation of why iTunes is a good thing – and my mind pictures dutiful Young Communists... With my android, I have downloaded apps to my phone, and downloaded them to my computer and copied them across to my SD card and installed them that way. Yes, iPhone fanatics, android phones (like almost every other type) allow you to add memory to your phone. I used the 4GB SD card I bought for my previous phone.
I installed XandPlayer so I can watch AVI files. I have video of my younger daughter getting her degree last year on my old SD card that I can watch. I’m sure I will put other AVI files onto the card soon to watch at a later time. It’s got loads of music already. Up until last week, I couldn’t watch an AVI on an iPhone. Obviously, I could have converted all my AVIs using their precious iTunes, but why should I? VLC player has just become available on an iPhone without needing to Jailbreak it. So iPhones can now play AVI files – welcome to the 21st century.
I installed Skyfire, which is a browser that allows you watch Flash files on Web sites. Apple takes the position that Flash will disappear when HTML5 becomes widely adopted and so iPhones don’t need the facility. I’m sure that Apple is correct. However, until that day in some distant future, and to ensure backward compatibility with all those Flash files out there, users need a flash player.
I could tell you about all the fun apps I have installed – Google Sky Map, Kindle, AroundMe, and many others, but I’m sure something similar is probably available for the iPhone.
Now, I know we’ve got the new Nokia phones with Symbian, the new Windows 7 phones, and Blackberry as the other big players in the market. But it strikes me that Apple set the bar very high with its iPhone and has shot itself in the foot with the restrictions placed on it. If iPhone Version 5 doesn’t offer something that no other company has thought of, or some degree of openness, then I believe that, like the Apple computer, the iPhone will be the phone-of-choice for die-hard Apple supporters only, while the rest of the phone-producing community steal all their best ideas, add more of their own, and sell more phones to very willing customers.
Now don’t go away with the idea that I am now some kind of android worshipper, I’m just someone who’s happy with his new phone. End of.
PS: don't forget it's Guide Share Europe at Whittlebury Hall on Tuesday and Wednesday this week. More details at www.gse.org.uk/tyc/invite.html.
PPS: don't forget to complete your mainframe user survey for the Arcati Mainframe Yearbook at www.arcati.com/usersurvey11.
I’ve recently acquired a Samsung Galaxy Apollo, which is a slightly cut-down version of their top-of-the-range Galaxy S. It seems to do everything I want and, of course, being an android phone, it has access to the thousands of free apps.
Now, it’s confession time, I think the iPhone is better at photography than my phone. I don’t have a flash with the camera, I can’t move the focus point round on the screen, and it doesn’t create composite photos to allow for lighting, so what would have been a shaded area becomes clearly visible. I’m also waiting for Android 2.2 (FroYo), which will offer more facilities.
But, and for me this was a deal breaker, it doesn’t need iTunes. Oh how restrictive iTunes is to its users! Now, again, I have listened to hours (or perhaps it just seemed that way) of explanation of why iTunes is a good thing – and my mind pictures dutiful Young Communists... With my android, I have downloaded apps to my phone, and downloaded them to my computer and copied them across to my SD card and installed them that way. Yes, iPhone fanatics, android phones (like almost every other type) allow you to add memory to your phone. I used the 4GB SD card I bought for my previous phone.
I installed XandPlayer so I can watch AVI files. I have video of my younger daughter getting her degree last year on my old SD card that I can watch. I’m sure I will put other AVI files onto the card soon to watch at a later time. It’s got loads of music already. Up until last week, I couldn’t watch an AVI on an iPhone. Obviously, I could have converted all my AVIs using their precious iTunes, but why should I? VLC player has just become available on an iPhone without needing to Jailbreak it. So iPhones can now play AVI files – welcome to the 21st century.
I installed Skyfire, which is a browser that allows you watch Flash files on Web sites. Apple takes the position that Flash will disappear when HTML5 becomes widely adopted and so iPhones don’t need the facility. I’m sure that Apple is correct. However, until that day in some distant future, and to ensure backward compatibility with all those Flash files out there, users need a flash player.
I could tell you about all the fun apps I have installed – Google Sky Map, Kindle, AroundMe, and many others, but I’m sure something similar is probably available for the iPhone.
Now, I know we’ve got the new Nokia phones with Symbian, the new Windows 7 phones, and Blackberry as the other big players in the market. But it strikes me that Apple set the bar very high with its iPhone and has shot itself in the foot with the restrictions placed on it. If iPhone Version 5 doesn’t offer something that no other company has thought of, or some degree of openness, then I believe that, like the Apple computer, the iPhone will be the phone-of-choice for die-hard Apple supporters only, while the rest of the phone-producing community steal all their best ideas, add more of their own, and sell more phones to very willing customers.
Now don’t go away with the idea that I am now some kind of android worshipper, I’m just someone who’s happy with his new phone. End of.
PS: don't forget it's Guide Share Europe at Whittlebury Hall on Tuesday and Wednesday this week. More details at www.gse.org.uk/tyc/invite.html.
PPS: don't forget to complete your mainframe user survey for the Arcati Mainframe Yearbook at www.arcati.com/usersurvey11.
Labels:
Android,
AroundMe,
AVI,
Blackberry,
blog,
Eddolls,
Flash,
Google Sky Map,
HTML5,
iPhone,
iTunes,
Kindle,
Nokia,
phone,
Samsung Galaxy Apollo,
Skyfire,
Symbian,
VLC,
Windows 7,
XandPlayer
Sunday, 9 May 2010
Web futures – they are among us
Rule number 1 of the Internet is, of course, that there are no rules – but if there were, it would be that the Internet is always changing and evolving. While some people have only just started to use style sheets and XHTML, others are pushing the envelope with CSS3 and HTML5. I want to have a quick look at what this all means.
There was a time when HTML5 seemed like something in the far future, but now Apple (purveyors of the unbelievable fascist iTunes and lots of really cool gadgets) claims that there’s no point worrying about the fact Adobe’s Flash doesn’t run on their iPhones because it will be sidelined when HTML5 is adopted. GoogleWave, the collaboration and communication software from Google, already uses HTML5.
In addition, many currently available browsers allow the clever new stuff in CSS3 and HTML5 to work already. Opera and Safari provide support. Firefox from Version 3.5 supports HTML5. And Explorer Version 8 does a bit, and the proposed Version 9 will do more.
CSS3 is simply the next generation of style sheets and it offers loads of clever stuff. The most exciting one – certainly for those of us who have developed Web sites using multiple images to achieve the same effect – is rounded corners. You can now have boxes with varying ‘roundnesses’ of corners (except in Explorer where they’re still square). You can specify a radius value and that affects how round the corners are. It also now becomes very easy to use borders.
The downside, at the moment, is that each piece of code needs to be repeated. Look at:
-moz-box-shadow: 3px 3px 3px #6c3;
-webkit-box-shadow: 3px 3px 3px #6c3;
-box-shadow: 3px 3px 3px #6c3;
The top line adds the shadow for Mozilla browsers (like Firefox). The second line issues the same commands for WebKit browsers (such as Safari and Chrome). The third line is for those browsers that already support the CSS3 standards (and that’s Firefox 3.1 and above and Safari 3 and above).
In addition to these tags, other, much longer, tags are available containing the word ‘Microsoft’ at the beginning. But this isn’t an anti-Microsoft rant (this week!), the excellent word-wrap tag is a Microsoft one.
There are lots of other clever CSS3 tricks in development too. You can create drop shadows, do impressively clever things with gradients, and make text become more transparent as you mouseover it. Have a look at http://css3generator.com/ and http://css3please.com/ for some excellent examples.
HTML5, as well as potentially making Flash (and Silverlight come to that) redundant, provides a way to make Web applications more easily available. It is much more than a simple mark-up syntax for documents. HTML5 now contains tags for things like navigation (nav), headers, footers, articles, and sections. Explorer is the only fly-in-the-ointment (as it were), which will come as a surprise to no-one. Explorer needs a bit of JavaScript in order for CSS to style the page. Something like document.createElement("nav"); is required for each of the new tags.
And the doctype to use at the top of your document is <!DOCTYPE html>. And handily – for those people who never quite got the hang of closing tags – you can just close with a ‘>’, you don’t need ‘ />’ as with XHTML.
HTML5 can offer developments in Web forms. There are video and audio APIs. There’s a drag-and-drop API with a draggable attribute. ‘History.pushState’ can be used with AJAX apps to give better back–button support. There’s also a 2D drawing API for scripting graphics using the new canvas element. In fact there’s loads of new good stuff with more being added all the time. And did I mention the Geolocation API? I should have – it definitely adds the “wow” factor.
Lots of people will be wanting to use the new APIs, and Web pages for people using appropriate browsers will be appearing more and more. Look out for it!
There was a time when HTML5 seemed like something in the far future, but now Apple (purveyors of the unbelievable fascist iTunes and lots of really cool gadgets) claims that there’s no point worrying about the fact Adobe’s Flash doesn’t run on their iPhones because it will be sidelined when HTML5 is adopted. GoogleWave, the collaboration and communication software from Google, already uses HTML5.
In addition, many currently available browsers allow the clever new stuff in CSS3 and HTML5 to work already. Opera and Safari provide support. Firefox from Version 3.5 supports HTML5. And Explorer Version 8 does a bit, and the proposed Version 9 will do more.
CSS3 is simply the next generation of style sheets and it offers loads of clever stuff. The most exciting one – certainly for those of us who have developed Web sites using multiple images to achieve the same effect – is rounded corners. You can now have boxes with varying ‘roundnesses’ of corners (except in Explorer where they’re still square). You can specify a radius value and that affects how round the corners are. It also now becomes very easy to use borders.
The downside, at the moment, is that each piece of code needs to be repeated. Look at:
-moz-box-shadow: 3px 3px 3px #6c3;
-webkit-box-shadow: 3px 3px 3px #6c3;
-box-shadow: 3px 3px 3px #6c3;
The top line adds the shadow for Mozilla browsers (like Firefox). The second line issues the same commands for WebKit browsers (such as Safari and Chrome). The third line is for those browsers that already support the CSS3 standards (and that’s Firefox 3.1 and above and Safari 3 and above).
In addition to these tags, other, much longer, tags are available containing the word ‘Microsoft’ at the beginning. But this isn’t an anti-Microsoft rant (this week!), the excellent word-wrap tag is a Microsoft one.
There are lots of other clever CSS3 tricks in development too. You can create drop shadows, do impressively clever things with gradients, and make text become more transparent as you mouseover it. Have a look at http://css3generator.com/ and http://css3please.com/ for some excellent examples.
HTML5, as well as potentially making Flash (and Silverlight come to that) redundant, provides a way to make Web applications more easily available. It is much more than a simple mark-up syntax for documents. HTML5 now contains tags for things like navigation (nav), headers, footers, articles, and sections. Explorer is the only fly-in-the-ointment (as it were), which will come as a surprise to no-one. Explorer needs a bit of JavaScript in order for CSS to style the page. Something like document.createElement("nav"); is required for each of the new tags.
And the doctype to use at the top of your document is <!DOCTYPE html>. And handily – for those people who never quite got the hang of closing tags – you can just close with a ‘>’, you don’t need ‘ />’ as with XHTML.
HTML5 can offer developments in Web forms. There are video and audio APIs. There’s a drag-and-drop API with a draggable attribute. ‘History.pushState’ can be used with AJAX apps to give better back–button support. There’s also a 2D drawing API for scripting graphics using the new canvas element. In fact there’s loads of new good stuff with more being added all the time. And did I mention the Geolocation API? I should have – it definitely adds the “wow” factor.
Lots of people will be wanting to use the new APIs, and Web pages for people using appropriate browsers will be appearing more and more. Look out for it!
Labels:
Adobe,
API,
blog,
Chrome,
CSS3,
Eddolls,
Explorer,
Firefox,
Flash,
futures,
Geolocation,
GoogleWave,
HTML5,
Internet,
JavaScript,
Opera,
Safari,
style sheet,
Web
Subscribe to:
Posts (Atom)