Class: LiveConsole::IOMethods::SocketIO

Inherits:
Object
  • Object
show all
Includes:
IOMethod
Defined in:
lib/live_console/io_methods/socket_io/socket_io.rb

Constant Summary collapse

DefaultOpts =
{
  :host => '127.0.0.1',
}.freeze
RequiredOpts =
DefaultOpts.keys + [:port]

Instance Method Summary collapse

Methods included from IOMethod

included, #missing_opts

Constructor Details

#initialize(opts) ⇒ SocketIO

Returns a new instance of SocketIO.



11
12
13
14
# File 'lib/live_console/io_methods/socket_io/socket_io.rb', line 11

def initialize(opts)
  super opts
  @server = TCPServer.new host, port
end

Instance Method Details

#get_connectionObject



16
17
18
# File 'lib/live_console/io_methods/socket_io/socket_io.rb', line 16

def get_connection
  LiveConsole::IOMethods::SocketIOConnection.new(@server, opts)
end