Rich,

I'm reviewing previous post regarding this point. In the mean time
here's a new draft for the group to take apart...

require "socket"

@@threadsOpen = ThreadGroup.new
listenIp = "0.0.0.0"
listenPort = 1234

socket = TCPServer.new(listenIp,listenPort)
socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, true)

while 
  thisThread = Thread.new(session = socket.accept) {|thisSession|
    while thisSession
      fromClient = thisSession.gets("\0") # assuming a flash client
      if fromClient != nil
        thisSession.write(fromClient)
        #puts (fromClient)
        #puts (@@threadsOpen.list)
        sleep 1
      else
        thisSession.close
        thisThread.kill        
      end
    end     
  }
  @@threadsOpen.add(thisThread)
end