Sha256: abc28ab11332edf4c0abfd627734ccc86225ef3dbed6466061df3d5b9fad9bc3

Contents?: true

Size: 596 Bytes

Versions: 2

Compression:

Stored size: 596 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"
  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.write ("GET / HTTP/1.1\r\nhost:wilkboardonline.com:80\r\nconnection:close\r\n\r\n")
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_write_during_resolve.rb
cool.io-0.9.0 spec/possible_tests/test_write_during_resolve.rb