The Third Wave of Push Technology will be coming

本文回顾了实时网络技术从1996年至2011年的发展历程,包括两个主要阶段:第一阶段以Webcasting为代表,但由于信息粒度过粗且非实时而未获成功;第二阶段以Comet技术为代表,满足了在线交易等场景下细粒度实时数据推送的需求;第三阶段则介绍了WebSocket标准及其对未来双向实时通信的影响。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  Push Technology, Comet, and WebSockets: 10 years of history from Lightstreamer's perspective
by Alessandro Alinone (originally published on Comet Daily)

More than ten years have passed since the creation of Lightstreamer. Now that Lightstreamer 4.0 is generally available, it is a good moment to look back at what happened in the history of Push/Comet and to share a short analysis of the current trends from Lightstreamer’s perspective.

1996-2000: The first wave of Push Technology (Webcasting)

At that time, Push Technology was mainly referred to techniques also known as webcasting, narrowcasting, or channeling. A channel was related to some category of information, and once the user registered with one or more channels, she would automatically receive the information, which was displayed by dedicated client software (thick applications, browser plug-ins, or special screen savers). In 1996, PointCast, the first push system based on channels, was created. Soon after, over thirty players entered this market, including Microsoft and Netscape. Push Technology was expected to become a killer application, but this forecast did not come true, and in 2000 that kind of Push Technology was finally dead. The main reason is that the pushed information was very coarse-grained and not real-time. Users did not need to find significant amounts of information downloaded to their computer every morning, most of which they would never read. Someone compared the first wave of Push Technology to having giant heaps of newspapers dumped on your doorstep every morning…

2000 onwards: The second wave of Push Technology (Comet)

Starting in 2000, the success of online security trading systems created a new need for real-time data being pushed to the user’s browser. The information had to be very fine-grained (at the level of a single field being updated) and very real-time (the lower the latency between the data generation and its delivery, the better the quality of the trading platform). The first players in this arena were Caplin and Lightstreamer, together with Pushlets and KnowNow. In these eleven years, Push Technology has kept evolving in many ways: by adding new features to the available solutions; by improving reliability and performance; by seeing many new entrants coming into this market niche; by proposing new standards.

The success of this wave is increasing, with more and more production systems taking benefit from the real-time data delivery. Most of the financial trading platforms currently employ some form of data push. Online auctions, betting, and gaming systems are moving in the same direction. And we are seeing several new projects in both the military and aerospace domains leveraging this wave of Push Technology.

The very dynamic nature of this set of technologies has made it very difficult to agree even on a common umbrella term. Below is a list of the many terms that can be somehow related to Push Technology (I am fully aware of the many, more or less subtle differences in place among such words):
  • Push Technology
  • Data Streaming
  • Data Push
  • Streaming AJAX
  • Reverse AJAX
  • AJAX Push
  • Comet
  • HTTP Streaming
  • HTTP Long Polling
  • Real-Time Web
  • Last Mile Messaging
  • Internet Messaging
  • Bi-directional HTTP
  • Full-Duplex Web Communication
  • WebSocket
How about Comet? When Alex Russell coined the Comet term in 2006, it seemed to be a very good umbrella word and we all started to adopt it. But then, partly due to marketing-originated differentiation needs, and partly due to actual technological differences, other terms kept emerging or being reused. In particular, starting from 2007, the interest began to focus on bi-directional communication, leading to a new wave of Push Technology (see next section). Notice that the list above tries to cover both these waves, as the boundaries between the two are very blurry and arbitrary.
The push channel (from server to client) can be implemented via several different techniques, such as:
  • Polling
  • Long Polling
  • Frame Streaming
  • Iframe Streaming
  • Flash Streaming
  • XHR Streaming
  • Server-Sent Events

Several protocols have been created in the past few years employing one or more of the techniques above. Some of them derive from open-source initiatives (e.g. Bayeux and BOSH) or from standard specifications (HTML5 Server-Sent Events), others (like Lightstreamer’s protocol) are proprietary. Even if Lightstreamer’s network protocol is publicly documented, we prefer to provide high-level APIs for each supported client-side technologies, including mobile applications. This way, we can keep full control over the heuristics mechanisms needed to choose the best delivery technique to use, including low-latency fall-back processes.

2007 onwards: The third wave of Push Technology (WebSocket)

Bi-directional communication
means not only pushing real-time messages from the server to the client, but also the reverse. This may seem awkward, as sending messages from the client to the server at the client’s discretion has always been the normal behavior of HTTP! In reality, the aspect that is considered new and important has been the ability to send such reverse messages with low latency and high frequency. In most cases HTTP can stream messages with low latency and high frequency from the server to the client, but it always requires a full round-trip to send messages from the client to the server. This is a constraint imposed by how browsers and proxies are implemented. And this is one of the reasons that led to the WebSocket specification, aimed at enabling full-duplex communication over a single TCP connection (the other main reason being to prevent intermediaries from buffering the streaming content, as it happens in some cases with HTTP).

At the time of writing, the WebSocket specification is still in draft status (the latest version is draft-ietf-hybi-thewebsocketprotocol-09) and its adoption by “infrastructure” vendors (including browsers, proxies, packet inspectors, antivirus’, etc.) is still extremely immature and fragmented.

Without WebSocket, the reverse push channel (from client to server) can be implemented on the top of a second HTTP connection. The major problem here is that the application code has no control over the binding between HTTP requests and HTTP connections, which are handled by a pool manager that is part of the browser. This means that the browser might decide to send two backward messages originated from the application code on the top of two different physical TCP connections, with the risk of altering the message order. This issue, together with the low-latency and high-frequency requirements mentioned above, originated the need for a sophisticated reverse channel implementation within the application layer, to guarantee message ordering, low latency, and high frequency.
For example, Lightstreamer implements all of the mechanisms needed to give the developer a high-level and robust abstraction over the HTTP reverse channel. In particular, Lightstreamer automatically manages message numbering and re-ordering, transparently batches messages to minimize the round trips, and implements guaranteed delivery, by means of acknowledgements and automatic retransmissions.

WebSocket simplifies the implementation of both the communication channels, but WebSocket is only a transport layer, over which application-level protocols need to be implemented. For example, most Push Technology solutions are based on publish-and-subscribe paradigms. WebSocket alone does not offer any pub/sub facility, which must be implemented on the top of it. Another example: WebSocket alone does not dictate any technique for throttling the data flow of filtering/conflating the data based on bandwidth constraints or on Internet congestion. Again, this is something left to a higher-level implementation. For these reasons, eleven years of experience originated from second-wave Push Technology will be invaluably precious for the success of the third wave. Furthermore, the transition between the two waves requires some years of co-existence, until WebSocket is: a) specified in final form; b) fully deployed across all infrastructure components, implying the abandonment of all the older browsers (for instance, at the time of writing, Microsoft’s Internet Explorer requires a separate download to support the current draft of WebSockets on both IE9 and IE10 beta).

As for Lightstreamer, we have been delaying the roll-out of WebSocket, waiting for the more stable specifications and better browser support. Now, we believe that the time has finally come to inject all the experience gained in the past years into the third wave of Push Technology. Our role will be to guarantee a smooth and safe transition between the waves, taking care of all the issues above.

Conclusion

Our perspective on the history of the technologies aimed at enabling the Real-Time Web (known under many different names and with different meanings, such as Push Technology, Comet, or WebSocket) will help with the new third wave that is centered around bi-directional communication in general, and the WebSocket standard in particular. I maintain that WebSocket needs to leverage the second wave of technology to be successful, due to: the necessity, for several more years, to be able to fall back to high quality Comet when needed, and the necessity to build application-level protocols and network management optimizations over WebSocket that have already been implemented and deployed on solid second-wave solutions.

 

 

本文的原始链接:http://cometdaily.com/2011/07/06/push-technology-comet-and-websockets-10-years-of-history-from-lightstreamers-perspective/

内容概要:本文档主要展示了C语言中关于字符串处理、指针操作以及动态内存分配的相关代码示例。首先介绍了如何实现键值对(“key=value”)字符串的解析,包括去除多余空格和根据键获取对应值的功能,并提供了相应的测试用例。接着演示了从给定字符串中分离出奇偶位置字符的方法,并将结果分别存储到两个不同的缓冲区中。此外,还探讨了常量(const)修饰符在变量和指针中的应用规则,解释了不同类型指针的区别及其使用场景。最后,详细讲解了如何动态分配二维字符数组,并实现了对这类数组的排序与释放操作。 适合人群:具有C语言基础的程序员或计算机科学相关专业的学生,尤其是那些希望深入理解字符串处理、指针操作以及动态内存管理机制的学习者。 使用场景及目标:①掌握如何高效地解析键值对字符串并去除其中的空白字符;②学会编写能够正确处理奇偶索引字符的函数;③理解const修饰符的作用范围及其对程序逻辑的影响;④熟悉动态分配二维字符数组的技术,并能对其进行有效的排序和清理。 阅读建议:由于本资源涉及较多底层概念和技术细节,建议读者先复习C语言基础知识,特别是指针和内存管理部分。在学习过程中,可以尝试动手编写类似的代码片段,以便更好地理解和掌握文中所介绍的各种技巧。同时,注意观察代码注释,它们对于理解复杂逻辑非常有帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值