Skip to content

Instantly share code, notes, and snippets.

@cmhobbs
Created August 20, 2010 21:39
Show Gist options
  • Save cmhobbs/541251 to your computer and use it in GitHub Desktop.
Save cmhobbs/541251 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'eventmachine'
module Client
def post_init
send_data "test_data.txt>"
EventMachine::send_file_data @signature, "test_data.txt"
end
def receive_data(data)
puts data
close_connection_after_writing
end
def unbind
puts "-- CONNECTION TERMINATED"
EventMachine::stop_event_loop
end
end
EventMachine::run {
EventMachine::connect 'YOUR_SERVER_HERE', 7799, Client
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment