Class: Vines::XmppServer
- Inherits:
-
Object
- Object
- Vines::XmppServer
- Includes:
- Log
- Defined in:
- lib/vines/xmpp_server.rb
Overview
The main starting point for the XMPP server process. Starts the EventMachine processing loop and registers the XMPP protocol handler with the ports defined in the server configuration file.
Instance Method Summary collapse
-
#initialize(config) ⇒ XmppServer
constructor
A new instance of XmppServer.
- #start ⇒ Object
Methods included from Log
Constructor Details
#initialize(config) ⇒ XmppServer
Returns a new instance of XmppServer.
11 12 13 |
# File 'lib/vines/xmpp_server.rb', line 11 def initialize(config) @config = config end |
Instance Method Details
#start ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/vines/xmpp_server.rb', line 15 def start log.info('XMPP server started') at_exit { log.fatal('XMPP server stopped') } EM.epoll EM.kqueue EM.run do @config.ports.each {|port| port.start } end end |