Skip to content

Instantly share code, notes, and snippets.

@Najaf
Created May 28, 2014 23:21
Show Gist options
  • Save Najaf/c6d6858511af83ea2d04 to your computer and use it in GitHub Desktop.
Save Najaf/c6d6858511af83ea2d04 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
require 'socket'
server = TCPServer.new ARGV.first.to_i
loop do
client = server.accept
client.write(client.readline)
client.close
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment