Skip to content

Instantly share code, notes, and snippets.

@IlkhamGaysin
Created March 17, 2017 09:08
Show Gist options
  • Save IlkhamGaysin/a321e4b799a426d548f5aa69f949481d to your computer and use it in GitHub Desktop.
Save IlkhamGaysin/a321e4b799a426d548f5aa69f949481d to your computer and use it in GitHub Desktop.
require 'socket'

server = TCPServer.new("127.0.0.1", 2000)
loop do
  Thread.start(server.accept) do |client|
    client.puts "Hello !"
    client.puts "Time is #{Time.now}"
    client.close
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment