Class: Eve::EventConnection

Inherits:
EM::Connection
  • Object
show all
Defined in:
lib/eve/event_server.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#appObject

Returns the value of attribute app.



7
8
9
# File 'lib/eve/event_server.rb', line 7

def app
  @app
end

#serverObject

Returns the value of attribute server.



7
8
9
# File 'lib/eve/event_server.rb', line 7

def server
  @server
end

Class Method Details

.run(args) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/eve/event_server.rb', line 9

def self.run(args)
  server,port,appid = EventServer.handle_args(args).values
  @@data = { :appid => appid }
  
  EM.run do
    EM.start_server(server, port, EventConnection)
    puts "Started Eve (#{appid}) on #{server}:#{port}..."
  end      
end

Instance Method Details

#post_initObject



19
20
21
22
# File 'lib/eve/event_server.rb', line 19

def post_init
  @server = EventServer.new(self,@@data)
  @server.post_init
end

#receive_data(data) ⇒ Object



24
25
26
# File 'lib/eve/event_server.rb', line 24

def receive_data(data)
  @server.receive_data(data)
end