Sha256: 67789396f9d0225afeb12566cf40340942e13892df28ae76c40afddb81341e1e

Contents?: true

Size: 662 Bytes

Versions: 57

Compression:

Stored size: 662 Bytes

Contents

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)

require 'rubygems'
require 'cool.io'

ADDR = '127.0.0.1'
PORT = 4321

cool.io.connect ADDR, PORT do
  on_connect do
    puts "Connected to #{remote_host}:#{remote_port}"
    write "bounce this back to me"
  end

  on_close do
    puts "Disconnected from #{remote_host}:#{remote_port}"
  end

  on_read do |data|
    puts "Got: #{data}"
    close
  end

  on_resolve_failed do
    puts "Error: Couldn't resolve #{remote_host}"
  end

  on_connect_failed do
    puts "Error: Connection refused to #{remote_host}:#{remote_port}"
  end
end

puts "Echo client connecting to #{ADDR}:#{PORT}..."
cool.io.run 

Version data entries

57 entries across 57 versions & 6 rubygems

Version Path
cool.io-1.9.0 examples/dslified_echo_client.rb
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/cool.io-1.8.1/examples/dslified_echo_client.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/cool.io-1.8.1/examples/dslified_echo_client.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/cool.io-1.8.1/examples/dslified_echo_client.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/cool.io-1.8.1/examples/dslified_echo_client.rb
cool.io-1.8.0 examples/dslified_echo_client.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/cool.io-1.7.1/examples/dslified_echo_client.rb
cool.io-1.7.1-x86-mingw32 examples/dslified_echo_client.rb
cool.io-1.7.1-x64-mingw32 examples/dslified_echo_client.rb
cool.io-1.7.1 examples/dslified_echo_client.rb
cool.io-1.7.0 examples/dslified_echo_client.rb
cool.io-1.6.1 examples/dslified_echo_client.rb
cool.io-1.6.0-x64-mingw32 examples/dslified_echo_client.rb
cool.io-1.6.0-x86-mingw32 examples/dslified_echo_client.rb
cool.io-1.6.0 examples/dslified_echo_client.rb
cool.io-1.5.4-x64-mingw32 examples/dslified_echo_client.rb
cool.io-1.5.4-x86-mingw32 examples/dslified_echo_client.rb
cool.io-1.5.4 examples/dslified_echo_client.rb
cool.io-1.5.3-x86-mingw32 examples/dslified_echo_client.rb
cool.io-1.5.3-x64-mingw32 examples/dslified_echo_client.rb