Skip to content

Instantly share code, notes, and snippets.

@smith
Created November 1, 2010 18:01
Show Gist options
  • Save smith/658609 to your computer and use it in GitHub Desktop.
Save smith/658609 to your computer and use it in GitHub Desktop.
require "rubygems"
require "eventmachine"
module EchoServer
def post_init
puts "-- someone connected to the EventMachine echo server!"
end
def receive_data data
send_data ">>>you sent: " + data
end
end
EventMachine::run do
EventMachine::start_server "0.0.0.0", 8081, EchoServer
puts "Running EventMachine echo server on 8081"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment