Ruby、Sinatra 和流媒体
我正在疯狂地尝试调试为什么 iTunes 不接受我发送给它的数据(作为 DAAP 服务器)- 你可以在github页面上看到我正在尝试做的事情。
我能发现我的响应和 mt-daapd 的相同响应(iTunes 确实接受)之间的唯一区别是 mt-daapd 响应被分解为小数据包,而不是一个大数据包(我使用 Wireshark 来打包)嗅嗅)
有谁知道如何告诉 Sinatra(在 Thin 上)这样做吗?或者知道为什么 iTunes 对 DAAP 服务器的响应如此挑剔:P
I'm furiously trying to debug why iTunes isn't accepting the data I'm sending to it (as a DAAP Server) -
you can see what I'm trying to do on the github page.
The only difference I can find between my response and an identical response from mt-daapd (which iTunes does accept) is that the mt-daapd response is broken down into small packets, rather than one big one (I'm using Wireshark to packet sniff)
Does anyone know how to tell Sinatra (on Thin) to do this? Or have any idea why iTunes is so picky as to the responses it expects from DAAP Servers :P
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 async.callback 进行流式传输或返回一个对象作为响应每个对象的主体,并通过给每个对象的块发送块。另外,如果您使用 Thin,您将在 EventMachine 事件循环内运行,这对于此类事情非常有帮助。
You can use async.callback for streaming or return an object as body that responds to each and sending chunks via the block given to each. Also, if you are using Thin, you are running inside an EventMachine event loop, which is very helpful with such things.