In article <87pt1zav3o.fsf / igloo.phubuh.org>, Mikael Brockman <mikael / phubuh.org> writes: >> Your example is quite special. Usually, when writing servers that >> serve huge chunks of data (like HTTP servers that also serve binary >> content, e.g. for download) then the usual (and proper) approach is to >> copy the file in chunks. Nobody writes a server that reads a 1GB file >> into memory first before sending it over the line. > > True. The files I'm sending are only a couple of megabytes. Still > takes a long time to send to, say, someone on 56K. An evil user may connect your server without reading. % ruby -rsocket -e 'TCPSocket.open("your-server", 12345); sleep' If the server writes to such client and TCP window is fill up, the server process (including other threads) may blocks. So I don't think it's negligible. I think this problem should be solved by nonblocking flag. I'm not sure that nonblocking flag is easy enough to use in Ruby, though. -- Tanaka Akira