Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
greubel
Visitor

Re: Stand alone server for Roku

I don't know if it's a good size but I send blocks of 20K until the size of the request or the connection drops.
I picked that size so I could possibly interleave with multiple connections.
So far the max that have been tested using my server, is streaming the same movie from the same server to five Roku boxes.
The five ran fine BUT still waiting for someone with more.
0 Kudos
ioan
Roku Guru

Re: Stand alone server for Roku

"greubel" wrote:
I don't know if it's a good size but I send blocks of 20K until the size of the request or the connection drops.


Thank you.
What about the requests without range, how do you handle them?
https://github.com/e1ioan/
http://rokucam.com
0 Kudos
greubel
Visitor

Re: Stand alone server for Roku

Same, 20k blocks
0 Kudos
ioan
Roku Guru

Re: Stand alone server for Roku

"greubel" wrote:
Same, 20k blocks


20K blocks ... starting from where? Do you keep a status for each Roku and you answer with the next block?

So for example, to the first request, the one without range, you send 0 to 20K, to the second one 20+1 to 41... etc?
If a request comes with range, do you still send your next 20K block using the range or just the next one that you didn't send yet (ignoring the range)?
https://github.com/e1ioan/
http://rokucam.com
0 Kudos
greubel
Visitor

Re: Stand alone server for Roku

No, say a request for 100K starting at 1000 comes in.
I would send a 20K block for 1000-20999 followed by 21000-40999 -- 41, 61, 81000-100999.
The blocks are sent as fast as I can read them in.
Continuing till the size is exhausted or EOF or connection drops.
0 Kudos
ioan
Roku Guru

Re: Stand alone server for Roku

I understand that part, when a request comes for a range you send the range in blocks of 20K. I'll setup my communication buffer to 20K too.
What I don't understand is what if a request comes and doesn't have a range? What do I answer to that one?


User-Agent: Roku/DVP-2.9 (012.09E01529A)
GET /Ancient%20Aliens/Ancient%20Aliens_20110126_20002100.mp4 HTTP/1.1


For this one, the Range start and Range end are both 0, and I saw those kind of request coming in the server at random times from Roku... should I just ignore those requests?
https://github.com/e1ioan/
http://rokucam.com
0 Kudos
greubel
Visitor

Re: Stand alone server for Roku

No, that implies the whole file ! So, first you need to know how big it is because that's part of the response.
Then you send the http header and the file from zero to the end.
0 Kudos
jbrave
Channel Surfer

Re: Stand alone server for Roku

Hi, can someone give me some tips on what to look for in making sure a server is correctly responding to range requests, for instance how to compare two server's responses (one that works and one that doesn't) to figure out what the difference is? I'm messing around in Wireshark, but not sure the best way to proceed with figuring out the differences.

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
RokuMarkn
Visitor

Re: Stand alone server for Roku

You can use curl from the command line. This downloads a complete file:

curl -s -o output1 -D /dev/stdout http://blah

Adding this -r flag downloads only the second byte:

curl -r1-1 -s -o output2 -D /dev/stdout http://blah


The things to look for in the second case are that the first line of the headers should be "206 Partial Content" rather than "200 OK", Content-Length should be "1", and there should be a "Content-Range" header. And of course output2 should contain one byte, the second byte that is in output1. Both commands should return an "Accept-Ranges: bytes" header.

--Mark
0 Kudos