fork a number of listening processes to increase the maximum number of connections
require 'socket'
server = TCPServer.new(1234)
5.times do
fork dowhile connection = server.accept
while line = connection.gets
breakif line =~ /quit/
puts line
connection.puts "Received!"
end
connection.puts "Closing the connection. Bye!"
connection.close
end
end
end