require 'rubygems' require 'eventmachine' class EchoClient < EventMachine::Connection attr_reader :response def receive_data(data) @response = data close_connection end def unbind EventMachine.stop_event_loop end end