Sha256: af0e44e25b19fd5b06664842bcea6c7c0ff96f74055c58cfa1ab45570be84d89
Contents?: true
Size: 345 Bytes
Versions: 84
Compression:
Stored size: 345 Bytes
Contents
#! /usr/bin/env ruby require 'socket' server = TCPServer.new('127.0.0.1', 9090) while (session = server.accept) puts "Found a session" request = session.gets puts "Request: #{request}" time = request.to_i puts "Sleeping for #{time}" sleep time session.print "Slept for #{time} seconds" session.close puts "Session closed" end
Version data entries
84 entries across 84 versions & 23 rubygems