in reply to HTTP::Daemon Pipe Breaking

  1. You do realize that your program is single-threaded, right? It does each connection in order. You have the listen set to 5, so if you get more than 5 requests while you are servicing one, the extra ones will get dropped.
  2. Your read of the image files is not optimal. Reading based on newlines is not efficient for a binary file. It will probably go faster if you get the file size and do a single read on it. Also, if you are on Windows, I am pretty sure you have to set binmode.

Replies are listed 'Best First'.
Re^2: HTTP::Daemon Pipe Breaking
by bkiahg (Pilgrim) on Jan 14, 2009 at 02:24 UTC
    So:

    1. Read up on making this multi-threaded. Would it be better if I fork them? Never been down this path.
    2. Figure out how to set binmode and do a lookup on the file size and do a single read.

    Check.