Sha256: 74805dbf2f7230bf8d698d8098bf8ae277c697d80e8c108882ed4235bc9d3b37

Contents?: true

Size: 413 Bytes

Versions: 57

Compression:

Stored size: 413 Bytes

Contents

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

require 'rubygems'
require 'cool.io'

ADDR = '127.0.0.1'
PORT = 4321

cool.io.server ADDR, PORT do
  on_connect do
    puts "#{remote_addr}:#{remote_port} connected"
  end

  on_close do
    puts "#{remote_addr}:#{remote_port} disconnected"
  end

  on_read do |data|
    write data
  end
end

puts "Echo server listening on #{ADDR}:#{PORT}"
cool.io.run

Version data entries

57 entries across 57 versions & 6 rubygems

Version Path
cool.io-1.5.3 examples/dslified_echo_server.rb
cool.io-1.5.2 examples/dslified_echo_server.rb
cool.io-1.5.1 examples/dslified_echo_server.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/cool.io-1.5.0/examples/dslified_echo_server.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/cool.io-1.5.0/examples/dslified_echo_server.rb
cool.io-1.5.0 examples/dslified_echo_server.rb
cool.io-1.4.6-x86-mingw32 examples/dslified_echo_server.rb
cool.io-1.4.6-x64-mingw32 examples/dslified_echo_server.rb
cool.io-1.4.6 examples/dslified_echo_server.rb
cool.io-1.4.5 examples/dslified_echo_server.rb
cool.io-1.4.5-x86-mingw32 examples/dslified_echo_server.rb
cool.io-1.4.5-x64-mingw32 examples/dslified_echo_server.rb
cool.io-1.4.5.pre1 examples/dslified_echo_server.rb
cool.io-1.4.5.pre1-x86-mingw32 examples/dslified_echo_server.rb
cool.io-1.4.5.pre1-x64-mingw32 examples/dslified_echo_server.rb
cool.io-1.4.4-x86-mingw32 examples/dslified_echo_server.rb
cool.io-1.4.4-x64-mingw32 examples/dslified_echo_server.rb
cool.io-1.4.4 examples/dslified_echo_server.rb
cool.io-1.4.3 examples/dslified_echo_server.rb
cool.io-1.4.2 examples/dslified_echo_server.rb