如何使用 HTTP 流协议传输实时数据。
据我所知,流媒体是实时数据传输的行为。 UDP通常与RTP(实时传输协议)一样用于传输实时数据。而HTTP Streaming使用的是TCP,那么它如何保证实时性呢?
As I know, streaming is action that transfer of real-time data. And UDP is usually used for transfer of real-time data as RTP (Real-time transfer protocol). While HTTP Streaming used TCP, so how do it ensure real-time ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于在客户端上使用输入缓冲区进行流式传输,想象一下 Flash 视频播放器(如 YouTube 的播放器)。一部分内容首先在客户端上缓冲,然后开始播放;如果缓冲区耗尽信息,您必须停下来重新填充缓冲区并继续播放。
您可以将 TCP 用于实时低带宽消耗的应用程序,例如聊天;但是当您需要大量带宽时,它不是最适合的协议,您应该使用 UDP,因为它不是面向连接的(例如 VoD 或有线电视)。
希望这有帮助。
For streaming using input buffers on the client, imagine a flash video player (like youtube's one).. a part of the content is buffered first on the client and then begins to play; if the buffer runs out of information you have to stop to refill the buffer and resume playing.
You can use TCP for low bandwith consumption apps in real time, such as chats; but when you need a lot of bandwith it's not the best suited protocol, you should use UDP because it isn't connection oriented (for example VoD or Cable TV).
Hope this helps.
在手册中您获得了所有请求和响应,例如 play
以下示例显示了 Play 请求。
以下示例显示了播放响应。
[http://msdn.microsoft.com/en-us/library/cc251235%28v=PROT.10%29.aspx][1]
[1]:http://msdn.microsoft.com/en-us/library/cc251235%28v=PROT.10%29.aspx在此处输入代码
在此处输入代码
in the manual you got all the requests and responses, for example play
The following example shows a Play request.
The following example shows a Play response.
[http://msdn.microsoft.com/en-us/library/cc251235%28v=PROT.10%29.aspx][1]
[1]: http://msdn.microsoft.com/en-us/library/cc251235%28v=PROT.10%29.aspxenter code here
enter code here