Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 866290409c
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (22 sloc) 0.586 kB
module EventMachine
module WebSocket
class WebSocketError < RuntimeError; end
class HandshakeError < WebSocketError; end
class DataError < WebSocketError; end
def self.start(options, &blk)
EM.epoll
EM.run do
trap("TERM") { stop }
trap("INT") { stop }
EventMachine::start_server(options[:host], options[:port],
EventMachine::WebSocket::Connection, options) do |c|
blk.call(c)
end
end
end
def self.stop
puts "Terminating WebSocket Server"
EventMachine.stop
end
end
end
Jump to Line
Something went wrong with that request. Please try again.