Sha256: fec20b63ab6631a24b78d9bb92ca70dafc0698b4c1bf4c1a970403eba9bb0948

Contents?: true

Size: 375 Bytes

Versions: 129

Compression:

Stored size: 375 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems' # or use Bundler.setup
require 'eventmachine'

class EchoServer < EM::Connection
  def receive_data(data)
    send_data(data)
  end
end

EventMachine.run do
  # hit Control + C to stop
  Signal.trap("INT")  { EventMachine.stop }
  Signal.trap("TERM") { EventMachine.stop }

  EventMachine.start_server("0.0.0.0", 10000, EchoServer)
end

Version data entries

129 entries across 126 versions & 10 rubygems

Version Path
eventmachine-1.0.0-java examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0-x86-mingw32 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0-x86-mswin32-60 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-maglev--1.0.0.rc.4 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-maglev--1.0.0.beta.4 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.4-java examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.4 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.4-x86-mswin32-60 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.4-x86-mingw32 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.3 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.3-x86-mswin32-60 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.3-x86-mingw32 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.3-java examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.2-java examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.2-x86-mswin32-60 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.2-x86-mingw32 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.2 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.1-x86-mswin32-60 examples/guides/getting_started/01_eventmachine_echo_server.rb
eventmachine-1.0.0.rc.1-x86-mingw32 examples/guides/getting_started/01_eventmachine_echo_server.rb