Home

Disneyland Vacation

Written by: NetworkError, on 22-06-2008 20:39
Last update: 04-11-2008 00:10
Published in: Public, What We're Up To
Views: 4633

We went on a Disneyland and San Diego Zoo vacation for almost two weeks from June 9th to June 20th. The trip went something like this:

Read more... Be first to comment this article   |   Print   |   Send to friend
 

Memorial Day Weekend

Written by: NetworkError, on 30-05-2008 11:06
Last update: 04-11-2008 00:09
Published in: Public, What We're Up To
Views: 4737

We went up to my brother Dan's place in Manila over the weekend. We went to the Dinosaur museum and the beach. Alice and Avery had fun at the beach. We built a giant sand castle with a moat that was about 5 feet in diameter. Kaiya liked the water but didn't like the sand. She doesn't like getting dirty. Undecided

Read more... Be first to comment this article   |   Print   |   Send to friend
   

HTTP 1.1 Request Pipelining

Written by: NetworkError, on 15-05-2008 15:26
Last update: 15-05-2008 15:36
Published in: Public, Technical Wootness
Views: 12161


When you're out browsing the web, you send an HTTP request for each file and the server returns an HTTP response for each request. Each request/response uses an independent connection.

HTTP 1.1 supports a thing called pipelining. Essentially, you send multiple requests over one connection and the server returns responses in the order they were requested. This allows you to recycle the same connection for consecutive requests.

Why would anyone want to do this? Well, if you're going to do a lot of HTTP requests, you'll quickly realize that connection overhead gets ugly. In fact, any time you make a lot of requests and open a lot of network sockets, you'll burn up more CPU on that than just about anything else. So let's say you're going to programatically download 10000 files from a server over HTTP; it's best to do it with a handful of connections rather than 10000 connections.

Read more... Be first to comment this article   |   Print   |   Send to friend
   

Streaming Media (and download resuming) with PHP

Written by: NetworkError, on 14-05-2008 21:05
Last update: 15-10-2008 21:30
Published in: Public, Technical Wootness
Views: 12052

When you download a file or stream a media file from a web server, the good ones will allow you to request portions of the file at a time. This gives you the ability to scan forward and backward through your media file or pause/resume a file download. You can do the same thing streaming a file through a PHP script.

You're probably asking why I want to do this in the first place. Well... Let's say I want to build a jukebox on my web server. All my friends come and login. They browser the music, make their selection, and the site gives them an m3u playlist file. They open the file in WinAmp or VLC and rock out for hours to my excellent collection.

Sounds great, yeah? But I don't want to give the world access to my music. So I keep my music in a non-web-accessible directory on my web server (or NAS). To get my music from the server to the client, I'll write a script that will act as a middle man. My m3u files will contain URLs with file ids and tokens associated with your login. When you pass a file id and a token, I'll stream your file. If you exceed your quota or your token expires, I stream you a 404 mp3 asking you to renew your session. (I could allow the user to re-activate their token, or just require them to re-download an m3u file with a new token.)

The URLs in my m3u files will look something like this:
#EXTM3U
#EXTINF:232,Bob Marley And The Wailers - Is This Love
http://networkerror.org/play_that_funky_music.php?file_id=1&token=1234
#EXTINF:429,Bob Marley And The Wailers - No Woman No Cry (Live)
http://networkerror.org/play_that_funky_music.php?file_id=2&token=1234

With all that out of the way, let's talk about how to go about streaming these files through PHP.

 

Read more... User comments (1)   |   Print   |   Send to friend
   

Page 4 of 4

<< Start < Prev 1 2 3 4 Next > End >>