简单的ruby web service with socket

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

require 'socket'                				# Get sockets from stdlib
server = TCPServer.open(2000)   				# Socket to listen on port 2000
loop {                          				# Servers run forever
  Thread.start(server.accept) do |client|
    client.puts(Time.now.ctime) 				# Send the time to the client
	client.puts "Closing the connection. Bye!"
    client.close                				# Disconnect from the client
  end
}