Sha256: e0e8d7a781a129b3ce43ede8fbfff69d245e2813afdbca78fb3d0f42981bc45c
Contents?: true
Size: 593 Bytes
Versions: 2
Compression:
Stored size: 593 Bytes
Contents
require File.dirname(__FILE__) + '/../rev' ADDR = 'wilkboardonline.com' PORT = 80 class ClientConnection < Rev::TCPSocket def on_connect puts "#{remote_addr}:#{remote_port} connected" write ("GET / HTTP/1.1\r\nhost:wilkboardonline.com:80\r\nconnection:close\r\n\r\n") end def on_close puts "#{remote_addr}:#{remote_port} disconnected" end def on_read(data) print "got #{data}" close end end event_loop = Rev::Loop.default client = ClientConnection.connect(ADDR, PORT) client.attach(event_loop) puts "Echo client started to #{ADDR}:#{PORT}" event_loop.run
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cool.io-1.0.0 | spec/possible_tests/test_resolves.rb |
cool.io-0.9.0 | spec/possible_tests/test_resolves.rb |