读取已传输编码分块的 Flex/Flash URL
我在从 Flex 读取具有 Transfer-Encoding: chunked 的 url 时遇到问题,因为 Flex 等待服务器发送终止信号,而在分块传输中不会发送该信号...
I have a problem reading from Flex a url which has Transfer-Encoding: chunked because the FLex waits for the server to send terminate signal which in chunked transfer isn't sent...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 URLStream 类而不是您现在使用的任何加载器。它的 ProgressEvents 将允许您在消息完成之前读取块。
Use the URLStream class instead of whatever loader you're using now. Its ProgressEvents will let you read chunks before the message completes.
但如果你仔细阅读文档,你会发现以下内容。所以很明显,你只需要检查接收到的块的大小,直到它变为零。
But if you read the documents a little more carefully, you will find the following. So it becomes clear, you just need to check the size of received chunks until it get ZERO.